Inserting into Oracle9i  DB from Visual Basic

Hi,
I have a Visual Basic 6.0 application that queries an Oracle database to insert into a table. In some cases it will insert fine and in others it won't. Am I doing something wrong in the way I query the Oracle database? I don't get any errors, it just doesn't insert the data. Here's my code that does not work:
QueryString = "insert into neworcldb10.SpectraDataItem (SpectraDataItemID,SpectraDBID,BandNumber,SpectraData) values " + "(" + CStr(OID.OID) + ", " + CStr(ParentSpectraOID.OID) + ", " + CStr(Band) + ", " + CStr(data) + " );"
DBHandle.Execute querystring, , adCmdText + adExecuteNoRecords
I've copied and pasted the query statement into sqlplus and it works fine there. I thought that it may be my connection, but the program inserts fine in other functions. Any help would be appreciated.
Thanks,
Malina

Suppose that you have something like this:
Dim my_conn_obj as ADODB.Connection
my_conn_obj.execute( "insert into neworcldb10.SpectraDataItem (SpectraDataItemID,SpectraDBID,BandNumber,SpectraData) values " + "(" + CStr(OID.OID) + ", " + CStr(ParentSpectraOID.OID) + ", " + CStr(Band) + ", " + CStr(data) + " );" )
Try to do that and post the results!
Joel Pérez

Similar Messages

  • Type Mismatch error while calling a Java Function from Visual Basic 6.0...

    Hi,
    I'm having a problem in calling the Java Applet's Function from Visual Basic. First, I'm getting the handle of the Java Applet and components of it using "Document.Applets(n)" which is a HTML function. I'm calling this function from Visual Basic. My code is something like this...
    ' // Web1 is IE Browser in my Form.
    Dim Ap,Comp
    Dim Bol as Boolean
    Bol = true
    Ap = Web1.Document.Applets(0).getWindow() ' \\ Gets the Parent Window.
    Ap.setTitle("My Java Applet") ' \\ Sets the Title of the window.
    msgbox Ap.getVisibility() ' \\ This will return a Java boolean ( true or false )
    Ap.setVisibility(Bol) ' \\ Function Syntax is : void setVisibility(boolean b)
    Here in my code , i'm able to call any function that which accepts Integer or String but not boolean. So, i m facing problem with Ap.setVisibility() function. It gives me a "Type mismatch error" while executing it. Can you please tell me a way to do this from Visual Basic !
    I'm using Visual Basic 6.0, Windows 2000 , J2SDK 1.4.2_05.
    Please help me Friends.
    Thanks and Regards,
    Srinivas Annam.

    Hi
    I am not sure about this solution. try this
    Declare a variable as variant and store the boolean value in that variable and then use in ur method.
    Post ur reply in this forum.
    bye for now
    sat

  • How to set the password encrytacion a database. Accdb from Visual Basic 2010 for a report. Rpl

    I want to know how to set the password encrytacion a database. Accdb from Visual Basic 2010 for a report. Rpl

    You have to connect via ODBC, then use code along the lines of what is described here:
    http://scn.sap.com/thread/3526924
    by me on March 28 and Jan on March 29.
    Also see KBA: 1686419 - SAP Crystal Reports designer does not recognize Access *.accdb file
    - Ludek
    Senior Support Engineer AGS Product Support, Global Support Center Canada
    Follow us on Twitter

  • Creating a DLL in Labview 8.6 and calling it from Visual Basic 6.0

    Dear friends,
    I need to create a DLL in Labview 8.6 and call it from Visual Basic 6.0. The system works as follows:
    I made an application using Labview 8.6 + Vision Assistant 8.6 where I can obtain the x,y coordinates of a template in an certain image being captured by an USB camera. The template coordinates change every time it moves and Visual Basic 6.0 must read these x,y values in real time. I found some information in the link http://zone.ni.com/devzone/cda/tut/p/id/3925, but it works for version 6.x of Labview and 8.6 version is different. Am I in the right path? If you have an updated tutorial like the one in the link above but for Labview 8.6 It would be very nice. Please help me.
    Kind regards.
    João Júnior

    Hello Osvaldo,
    I analysed the updated tutorial you sent me, but the thing is that it doen't show how to create the DLL in LV 8.6 but only show how to accessing the DLL from VB6. My problem is really HOW TO CREATE THE DLL IN LV8.6. In the link http://zone.ni.com/devzone/cda/tut/p/id/3063 there is detailed information about how to do this in LV6.x, the problem is that I don't find the path Tools»Build Application or Shared Library (DLL) in LV8.6, I think the procedure in LV8.6 is a little bit different. Don´t you have an updated tutorial on how to build a dll in LV8.6?How could you help me?
    Kind regards.
    João Júnior

  • Calling a dll created with vision 7.0 from visual basic doesn't work

    I created a dll using some vision 7.0 functions and Labview 7.0 environment. I call this dll from visual basic. The dll will work fine as long as I don't stop the visual basic program execution. As soon as I stop the program execution the dll will no longer work. I must reload the visual basic environment and the call to the dll will start working again. I created the exact same dll but I created it with vision 6.0 in Labview 6i environment. It works great and has no issues.
    Attachments:
    Test.vi ‏36 KB

    Roberto N. wrote:
    Thank you Jordan, I'm using Labview 7.1.
    Anyway I've resolved the problem by adding the "lvanlys.dll" file (present in "..\Labview 7.1\resource\lvanlys.dll" path) as support file in the building process. Now the DLL containing the analysis functions works correctly.
    Natalino Roberto
    Ok, you probably got lucky since the lvanlys.dll seems to implement that function directly. However most Advanced Analysis functions are just redirected by lvanlys.dll to the Intel Math Kerneal Library that gets installed with LabVIEW 7.1 and higher. The only way to get that properly installed with your LabVIEW executable or DLL is to create a LabVIEW installer in your Application Builder and make sure to select under "Installer Settings->Advanced" the "LabVIEW Run-Time Engine" and the "Analyze VIs Support". Then use that installer to install your DLL on another computer.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • How can I get the version of the GPIB driver from Visual Basic ?

    I want to readout from visual Basic which version of GPIB-Driver is installed on the PC. I must change some parameters for my application when GPIB 2.0 runs instead of 1.7.
    Thanks for any solution...

    Hi,
    The driver should create a key in registry depending on the driver version. Check for the existance of HKEY_LOCAL_MACHINE\SOFTWARE\National Instruments\NI-488.2M\ (In my case I had a folder called 2.00).
    Hope this helps out.
    Best Regards,
    Aaron K.
    Application Engineer
    National Instruments

  • Insertion into local table from remote table with contains clause

    Hi all,
    We are tasked to insert some rows into our database from another database. We tried to use DBLinks to link the 2 databases and were able to use Select statements to filter out the data that we need to insert into our database.
    These statements take the form of: Select * from RemoteTable where contains@RemoteLink(IndexColumn, 'car')>0;
    where RemoteLink is the DBLink that we have created.
    However Oracle gave us an error (ORA-00949: illegal reference to remote table) when we tried to insert the dataset from the above statement into our local table. We used the following statement in doing so: Insert Into LocalTable (Select * from RemoteTable where contains@RemoteLink(IndexColumn, 'car')>0);
    Even if we use Create Table, Oracle gave us the same error when we tried to push the data from the Select Statement into the new table.
    Could anyone advise us whether it is possible to insert such data into a local table? And if som what is the proper way of doing it?
    Many thanks to any advises.

    Hi,
    there is document 261741.1 on Metalink. This states explicitly that it is not possible to invoke remote user-defined operators, and contains is such. The solution given in the article is to create a wrapper function on the remote site and this one calling in stead of contains.
    Herald ten Dam
    htendam.wordpress.com

  • How to connect to oracle database from visual basic 2010 express edition

    I have installed visual basic 2010 express edition on windows xp. But visual basic 2010 express edition supports Microsoft sql server database file,Microsoft sql server compact 3.5, Microsoft access database file. I want to connect to oracle database from visual basic 2010 express edition. So what drivers are required and how to do connectivity?

    Hello,
    I wasn't clear on what you were using to make the connection. I had a look in Visual Studio 2010 (don't have express to test sorry).
    I think you mean the Data Sources available under the menu Data-> Datasources. this seems to match the description you give when I
    look at the list of datasource options.
    In here you can make ODBC connections via the Microsoft .net Data Provider .
    If you select ODBC as a datasource you can see listed the DSN's you created - for example I see 2 which use the Oracle ODBC driver.
    This assumes you installed an Oracle Client + the oracle version of the ODBC driver (comes with the oracle client).
    Once you created a server connection then you should see it in the server explorer.
    You can also download the Oracle Developer Tools for Visual Studio which is an add on for VS.
    ** I suspect this is only for VS 2010 and I didn't see that Express was supported.
    http://www.oracle.com/technetwork/developer-tools/visual-studio/overview/index-097110.html
    Let me know if that helps.
    John

  • ActiveMovie Control,Translating ActiveX calls from Visual Basic into Labview

    Hello,
    I want to use DirectX to display a movie. In the attached file is a Visual Basic example
    which I tried to translate into Labview.
    To play the movie IMediaControl from ActiveMovie control type library Version 1.0 C:\WINDOWS\system32\Quartz.dll) is used.
    To display the current Position I tried to wire the IMediaPostion. But I have no idea how to implement this in the Block Diagram.
    After opening it the following message is shown.
    Error 3005 occurred at Automation Open: Object specified is not creatable in Play Movie Current Possition.vi
    Attachments:
    Play_Movie_Current_Possition.vi ‏48 KB

    Hello Joe,
    the Windows Media Player has a lot of overhead. I also found it difficult to deal with the different Versions.
    I want to display data in a graph and show the connected video frame in a separate window.
    I used the QuartzTypeLib because it is on every Windows Computer and is easy to code in VB.
    With one call I can start the video in Labview., but I find no way to wire the current position. I do not really understand how ActiveX is implemented in Labview. I attached a LV 7.0 vi. I hope you can open it.
    Tiemo
    Attachments:
    Play_Movie_Current_Position.vi ‏63 KB

  • Migrating Application FROM Visual Basic

    Hi Everyone,
    I have an application written in Visual Basic (Front End) and SQL Server as the Back End. Now this application should run on the web i.e need to web enable the application.I have coded in Java for sometime now,but I do not have any prior knowledge as to build a Web application from scratch.Can anyone let me know
    how to procced.I would like to use open source like JDK for development.Eclipse for IDE.
    Thanks,
    Supriya.

    First off let's get VB specific -- Are you using Access as a local database and container for your queries? If you are then read on, otherwise, the information already give is excellent and complete enough to get you well on your way.
    1 - You are going to have to conver all of your queries either to SQL and store them in a business layer, or create stored procedures for them on the server. I strongly recomend the stored procedure route to hide any detail of your dataserver as much as possible and supply tighter security for table access.
    2 - Your web server is going to be a significant ralleying point for your data and return HTML generation, you should take that into consideration with your IT staff and how it will affect other applications on that server. (It will probably not have sufficient impact, unless you already have your own dedicated server for this application)
    3 - As mentioned by the others, the Applet/Servlet or JSP/Servlet configuation will serve you very well for your application.

  • How to insert into a table from 3 tables?

    Hello,
    How to insert into a table getting values from 3 different tables?
    For example table_A has col_1 to col_10.
    I want to insert into table_A,
    values: col_1 to col_4 are from table_B,
    col_5 is from table_C,
    col_6 to col_10 are from table_D.
    Thanks!

    Normally, you'd do this by joining B, C, and D together. In the simplest case, something like
    INSERT INTO A( col1, ... col10 )
      SELECT B.col1, ..., B.col4,
             C.col5,
             D.col6, ..., D.col10
        FROM B,
             C,
             D,
       WHERE B.someKeyColumn = C.someKeyColumn
         AND C.anotherKeyColumn = D.anotherKeyColumnYou'd have to know how the data in B, C, and D relate to fill in the WHERE clause. This basically tells Oracle how to match the data in a particular row in B with the data in a particular row in C with the data in a particular row in D.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • How to insert into xml table from relational table

    I wrote a sqlstaement that selects value from the relational tables. Now I want to replace root node "<event_start01>" with following value to the above selected xml string. My select returns root node and all nodes and elements of the root node.
    I tried holding above sellected value into varchar2 variable but I get ora-00600 error. If I hold above selected values into xmltype variable then I am not able to replace root node with the following value.
    I want to rplace rootnode with the following string.
    INSERT INTO FRMD_EVENT_START01(xml_event_start) VALUES
    (XMLTYPE('<event_start01
    xmlns="event_start01.xsd"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="event_start01.xsd
    event_start01.xsd">

    Normally, you'd do this by joining B, C, and D together. In the simplest case, something like
    INSERT INTO A( col1, ... col10 )
      SELECT B.col1, ..., B.col4,
             C.col5,
             D.col6, ..., D.col10
        FROM B,
             C,
             D,
       WHERE B.someKeyColumn = C.someKeyColumn
         AND C.anotherKeyColumn = D.anotherKeyColumnYou'd have to know how the data in B, C, and D relate to fill in the WHERE clause. This basically tells Oracle how to match the data in a particular row in B with the data in a particular row in C with the data in a particular row in D.
    Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC

  • Can not select the VISA library (visa32.dl​l) as a reference from Visual Basic.

    I have a copy of Labview base package version 5.1.1 and Microsoft Visual Basic 6.0 in my PII 333 128M PC. I like to use the NI-VISA feature to develope my own testing program by using Visual Basic. However, the NI-VISA library (i.e. visa32.dll) can not be found from the Visual Basic reference library.

    Go PROJECT | REFERENCES menu. In the list, look for "VISA library".
    If the list does not show it, then BROWSE the visa32.dll located in the
    WinNT\SYSTEM32 folder.
    If the VISA library is earlier than V2.x, there is no TypeLib supported.
    Makoto
    "rfan99" wrote in message
    news:506500000008000000B6180000-984882144000@quiq.​com...
    > I have a copy of Labview base package version 5.1.1 and Microsoft
    > Visual Basic 6.0 in my PII 333 128M PC. I like to use the NI-VISA
    > feature to develope my own testing program by using Visual Basic.
    > However, the NI-VISA library (i.e. visa32.dll) can not be found from
    > the Visual Basic reference library.

  • Apex Application inserting into two tables from two regions in a page

    Hey Guys,
    Fairly new to apex like two days. So please bare with me. I am using apex 4.0.2.00.07.
    I have a page with two regions. The first region has only one row and I have no problems accessing it and inserting those values into the table this is what I used to access one column from that one row APEX_APPLICATION.G_F03(1)
    The second region is an interactive report, to which I have managed to add a checkbox and a textbox.
    1)So if a checkbox has been checked off the row should be inserted
    2) if the textbox has been entered it should replaceone of the values.
    My question is how to access the second region? I started a loop based on the rows in the collection but that is as far as I got.
    FOR idx IN 1..l_collectionTable_name
    loop
    end loop
    Any help would be greatly appreciated?
    Thank you
    Edited by: Aj05 on Aug 2, 2012 2:10 PM

    Hi Phil I used the following code
    <cfquery name="qArrivalDates" datasource="rayannesql">
    SET NOCOUNT ON
    INSERT INTO booking (book_made, book_checkin_date,
    book_checkout_date, book_adults, book_children)
    VALUES('#FORM.book_made#','#FORM.book_checkin_date#','#FORM.book_checkout_date#','#FORM.bo ok_adults#','#FORM.book_children#')
    SELECT SCOPE_IDENTITY() AS theNewId;
    SET NOCOUNT OFF
    </cfquery>
    <cfquery name="qArrivalDates" datasource="rayannesql">
    INSERT INTO Customer( firstname, lastname, address, address2,
    city, state, postalcode, country, phone, mobile, email, notes)
    Values (#qArrivalDates.theNewId# '#FORM.firstname#',
    '#FORM.lastname#', '#FORM.address#', '#FORM.address2#',
    '#FORM.city#', '#FORM.state#', '#FORM.postalcode#',
    '#FORM.country#', '#FORM.phone#', '#FORM.mobile#', '#FORM.email#',
    '#FORM.notes#' )
    </cfquery>
    When I tried to complete the form, I got the following error
    Macromedia][SequeLink JDBC Driver][ODBC
    Socket][Microsoft][SQL Native Client][SQL Server]Incorrect syntax
    near 'Fred'.
    The error occurred in
    C:\Inetpub\wwwroot\rayanne\customerinsertsql.cfm: line 16
    14 : <cfquery name="qArrivalDates"
    datasource="rayannesql">
    15 : INSERT INTO Customer( firstname, lastname, address,
    address2, city, state, postalcode, country, phone, mobile, email,
    notes)
    16 : Values (#qArrivalDates.theNewId# '#FORM.firstname#',
    '#FORM.lastname#', '#FORM.address#', '#FORM.address2#',
    '#FORM.city#', '#FORM.state#', '#FORM.postalcode#',
    '#FORM.country#', '#FORM.phone#', '#FORM.mobile#', '#FORM.email#',
    '#FORM.notes#' )
    17 : </cfquery>

  • How to set transceiver mode to 2-wire TXRDY Auto from Visual Basic

    I am using a PCMCIA-485 adapter to interface to some RS-485 sensors. The sensors are connected using a 2-wire interface. I have developed an application in Visual Basic to control the various sensors. However, the application is dependent on the PCMCIA-485 adapter's transceiver mode being configured into the "2-Wire TXRDY Auto" mode. Presently I require the user to configure the transceiver mode by opening up the advanced setting dialog within the device driver for the adapter and manually setting the transceiver mode. I would prefer to have my application take care of this directly. Unfortunately, I cannot find any references that document how to do this.
    Can I use Measurement Studio Tools for
    Visual Basic to control the transceiver mode of the PCMCIA-485 adapter?

    Hello-
    There is a registry key in Windows that can change this mode:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Serial\Parameters\Serial1000X\TransceiverMode
    Try experimenting with it by hand first. It may also be necessary to reboot after changing this value.
    Randy Solomonson
    Application Engineer
    National Instruments

Maybe you are looking for

  • SDO_ORDINATES.X.Field in data file exceeds maximum length

    Hi All, While loading data in .SHP file into oracle spatial through SHP2SDO tool following error message appears: Error message: Record 54284: Rejected - Error on table GEO_PARCEL_CENTROID, column CENTROID_GEOM.SDO_ORDINATES.X. Field in data file exc

  • Need Help with creating photo CD's

    PSE 7.0....using "share", I created a few CDs the other day with no problem.  Now it doesn't see the blank CD...I've tried several and it just doesn't see it...it sees the drive, but not the blank CD when I put one in...I ran a registry cleaner in be

  • GNOME 3.2 [GDM] brightness level at minimum by default?

    After I updated to GNOME 3.2, I noticed a strange problem; When I boot I just get a blank (black) screen and no GDM! - But when I adjust my brightness to maximum I can see GDM as usual and everything is working as expected. I did a little research, b

  • Due analysis reports

    I have  a Posting date ,0calday,doctype,amount field in the ARcube. During runtime User can enter the 0calday-current date no ofdays based on that current date -posting date I have to caluclate no of days Report format is posting date docutype amount

  • System getting shutdown

    my system is getting shutdown often and before getting shutdown one blue screen appears and showing some dumping percentage. also some low disk space error...........how can i fix it?