Visual Basic 5/Oracle DB

Hi,
I need help to insert a date in a oracle table through VB 5. I am using ODBCDirect, but always I have run time error '3146: ODBC -- Call faild; ORA-00932:inconsistent datatypes. I can do this with text and numeric fields but I can't with date field.
Below I write an example how I try:
Option Explicit
Dim wrkODBC As Workspace
Dim conn As Connection
Private Sub Form_Load()
Set wrkODBC = CreateWorkspace("NewODBCWorkspace", "admin", " ", dbUseODBC)
Set conn = wrkODBC.OpenConnection("", , , _
"ODBC;DATABASE=SAMPLE;UID=;PWD=;DSN=SAMPLE1")
End Sub
Private Sub bt_ok_Click()
Dim strSQL As String
Dim Qd As QueryDef
Dim v_data1
Dim v_text1
Dim v_num1
On Error Resume Next
v_data1 = #8/24/00# 'I try with v_data1 = CDate("24-08-2000")
v_text1 = "abc"
v_num1 = 100
wrkODBC.BeginTrans
strSQL = "insert into datateste (data1) values (" & v_data1 & ")" ' Don't work
strSQL = "insert into datateste (text1) values ('" & v_text & "')" ' Work well
strSQL = "insert into datateste (num1) values (" & v_num1 & ")" ' Work well
Set Qd = conn.CreateQueryDef("", strSQL)
Qd .Execute
wrkODBC.CommitTrans
End Sub
I done this using ODBC Oracle73 ver 2.5 (2.05.03.01) with Oracle 7.3 and Oracle ODBC Driver 8.00.05.00 with Oracle 8.
I apreciate any kind of help.
Carlos Aleixo
null

First, thank you for reply my question.
The table definition is below:
SQL> desc datateste;
Nome Nulo? Tipo
DATA1 DATE
DT_DESC VARCHAR2(10)
Carlos Aleixo
null

Similar Messages

  • How do I use the Oracle Developer Reporting Control in Visual Basic 6.0?

    I was wondering how to use the Oracle Developer Reporting Control componant in Visual Basic 6.0 to generate reports in Oracle Reports? Any help would be appreciated.

    Hi Rohit,
    Would like to ask you some questions about the oracle report with Visual Basic.
    1. I have a report built in oracle report. Currently there is a Visual Basic program want to pass some parameter to this report. Can Visual Basic program pass the parameter to this oracel report?
    2. Based on yr answer, do i have to installed the oracle report? or just copy and register the Rwsxa60.ocx (i'm using oracle report 6i) in the PC? So can i use this activeX control.
    3. Is this activeX control similar to Crystal report object which can found in VB?
    4. Is there an example/guide on how the Visual Basic pass the parameter to oracel form?
    Your answer will be much appreciated.
    Thanks.
    Regards,
    Hock Leong

  • Oracle DLL Error using AQ (in Oracle 10g) from Visual Basic

    Hi, everybody
    I have a Visual Basic 6 (with SP 6) application which connect to Oracle through an ODBC connection. Not only the client but also the server use Oracle 10.2.0.3.
    The application accesses to Oracle Queues by using OraAQ, OraDatabase, OraSession... objects.
    Everything works all right until the moment of closing the application; when the OraAQ object is disposed, an error in a DLL occurs. The DLL is orageneric10.dll, and it causes a Windows error which closes the application. Windows XP is used as operating system.
    The error only happens with the OraAQ object; other objects are disposed without any problem.
    Please, if somebody have an explanation, let me know. It is a very important issue for us.
    Thanks in advance

    Has anyone discovered an answer to this yet? I get the same issue, but am struggling to find a solution anywhere.
    (VB.NET on Visual Studio 2005, Flash CS5, Flash Player 10.1.85.3, AS3)

  • Oracle SQL/ Excel Visual Basic Consulting Opportunity in New York City

    Hello:
    Is anyone interested in a consulting opportunity?
    I am marketing director for a catalog/internet business in Manhattan. I am running Oracle 9.2i . We use the datawarehouse for many marketing/merchandising reports. I have SQL code embedded in Excel workbooks using an ODBC interface. The SQL code gets the data and then I have a lot of Visual Basic macros that run and create the reports.
    I need someone to come in and help me optimize the queries and macros (since I am self-taught on both SQL and VB there is LOTS of room for improvement).
    Since some of the reports are popular, I am getting overwhelmed with requests for new reports and it is taking time away from my marketing responsibilities.
    If anyone out there is interested, please let me know
    Thanks

    Hello:
    Is anyone interested in a consulting opportunity?
    I am marketing director for a catalog/internet
    business in Manhattan. I am running Oracle 9.2i .Sounds interesting, but as you can see in my profile, I'm not able to just "come in". Maybe someone else here wants to pick up this opportunity.
    We use the datawarehouse for many
    y marketing/merchandising reports. I have SQL code
    embedded in Excel workbooks using an ODBC interface.Reminds me of one of my customers that had a ms access frontend and oracle backend.
    The SQL code gets the data and then I have a lot of
    f Visual Basic macros that run and create the
    reports. Memories comin' back ... ;-)
    I need someone to come in and help me optimize the
    queries and macros (since I am self-taught on both
    SQL and VB there is LOTS of room for improvement). I'd say one approach could be to move some of the logic to views or pipelined functions, maybe ref cursors.
    Since some of the reports are popular, I am getting
    overwhelmed with requests for new reports and it is
    taking time away from my marketing responsibilities.Maybe it's also time to rethink the tool selection? ms access or a decent report generator could be an option.
    C.

  • 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

  • How to [b]store image[/b] in a [b]oracle database[/using [b]Visual Basic  ?

    I want to store an image (like jpg, bmp file) in a oracle Database using Visual Basic 6.0, Please Help me How can i do this.

    This url has a sample in VB which stores and retrieves images from database using VB
    http://otn.oracle.com/sample_code/tech/windows/ole_db/oledb8/content.html
    Chandar

  • How to access Oracle Data Base on Unix using Visual Basic ?

    Hi !
    I want to use visual basic and access the Oracle Data Base on Unix server. How can i do that ? Do i need any software?
    .Prashant

    You need an oracle client installation and setup your TNS names.

  • Error executing Stored Procedure that returns a recordset in Visual Basic 6

    Hello, i tried to use the example in the link posted as a response to my question in a previous thread, and in Visual Basic 6, when i execute the Stored procedure it gives me the following error:
    This is the package created as indicated in the example FAQ you posted.
    package types
    as
    type cursorType is ref cursor;
    end;
    This is the procedure created as indicated in the example FAQ you posted.
    PROCEDURE SP_TITUVALO(T_BR IN VARCHAR2,
    P_Cursor OUT TYPES.cursorType )
    AS
    BEGIN
    OPEN P_Cursor FOR
    SELECT * FROM TASAS WHERE BR=T_BR AND TASA > 0;
    END;
    This is the code used to execute the Stored Procedure in VB6:
    Dim objConn As New ADODB.Connection
    Dim connString
    Dim cmdStoredProc As New ADODB.Command
    Dim param1 As New ADODB.Parameter
    Dim RS As ADODB.Recordset
    Set param1 = cmdStoredProc.CreateParameter("T_BR", adVarChar, adParamInput, 255, "97")
    cmdStoredProc.Parameters.Append param1
    objConn.Open strconex
    Set cmdStoredProc.ActiveConnection = objConn
    cmdStoredProc.CommandText = "SP_TITUVALO"
    cmdStoredProc.CommandType = adCmdStoredProc
    Set RS = cmdStoredProc.Execute
    This is the error returned:
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'SP_TITUVALO'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    ****************************************************************

    Juan,
    Not sure about FAQ you are referring to, but it seems that you need to set PLSQLRSet property of ADODB.Command to TRUE. Because if you fail to do so - errors with refcursors are likely to happen.
    Consider:
    Set objConn = CreateObject("ADODB.Connection")
    objConn.ConnectionString = "Provider=OraOLEDB.Oracle;Persist Security Info=False;Data Source=test9ora;User ID=max;Password=blabla"
    objConn.Open
    'Dim cmdStoredProc
    Set cmdStoredProc = CreateObject("ADODB.Command")
    Dim param1
    Set param1 = cmdStoredProc.CreateParameter("T_BR", adVarChar, adParamInput, 255, "97")
    param1.Value = "X"
    cmdStoredProc.Parameters.Append param1
    'Dim RS
    Set cmdStoredProc.ActiveConnection = objConn
    'The following line was missed out
    cmdStoredProc.Properties("PLSQLRSet") = True
    cmdStoredProc.CommandText = "SP_TITUVALO"
    cmdStoredProc.CommandType = adCmdStoredProc
    Set RS = cmdStoredProc.ExecuteThis works fine, at least for me.
    Cheers.

  • 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

  • Stored Procedure w/ binary data parameter problems in Visual Basic

    Howdy all.
    I am having a problem calling stored procedures with a BLOB parameter. I have tried changing the paramater other data types to see if it would work, but with no success. I am calling the stored procedure from Visual Basic using ADO. I am using the Oracle ODBC Driver, Release 9.2.0.4.0. I have tried changing the setup of the ODBC a good bit because that has fixed several problems for me in the past; however, it did not fix my current problem.
    Here is what I am trying to do. I have a function like the folowing:
    <BEGIN --------------------------------------->
    CREATE OR REPLACE FUNCTION PAGEFORMATSINSERT(
    p_ObjectFormatCode_ID      IN RAW DEFAULT NULL,
    p_PA_ID      IN RAW DEFAULT NULL,
    p_Name      IN VARCHAR2 DEFAULT NULL,
    p_FormatData      IN BLOB DEFAULT NULL,
    p_PF_ID      IN OUT RAW )
    RETURN INTEGER
    AS
    BEGIN
    INSERT INTO PAGEFORMATS (PF_ID, ObjectFormatCode_ID, PA_ID, Name, FormatData) /* <---- this FormatData column is a BLOB column */
    VALUES     (p_PF_ID, p_ObjectFormatCode_ID, p_PA_ID, p_Name, p_FormatData)
    END PAGEFORMATSINSERT;
    <END ----------------------------------------->
    The FormatData parameter has a data type of BLOB. In my Visual Basic, I have my ADODB.Command object. I am setting the CommandText of the Command object to "{? = call PageFormatsInsert(?, ?, ?, ?, ?)}". In order to set the parameter value for the BLOB data type, I am calling the AppendChunk function of the Command object - passing it a Byte array.
    I am getting the folling error:
         ERROR: -2147467259 [Oracle][ODBC][Ora]ORA-06550: line 1, column 13:
         PLS-00306: wrong number or types of arguments in call to 'PAGEFORMATSINSERT'
         ORA-06550: line 1, column 7:
         PL/SQL: Statement ignored
    If I change the FormatData parameter to a LONG RAW parameter, I get the following error:
         ERROR: -2147467259 [Oracle][ODBC][Ora]ORA-06502: PL/SQL: numeric or value error: hex to raw conversion error
         ORA-06512: at line 1
    I am at a loss as to how to get binary data into by Oracle database. I need to do it using stored procedures. How can I set up my stored procedure or table to do what I want it to do? Should I change my table definition? Are there some settings in the ODBC connection I can tweak? How can I get the stored procedure to accept my call from VB ADO?
    Any help would be appreciated.
    wally

    Thanks for the idea, but I don't get how I am supposed to get my binary data to the stored procedure using the stream. I have a binary array that I want to pass to a stored procedure. I want to be able to use the same Visual Basic front end with out MSSQL database as with our Oracle database.
    I am using the ADODB Connection and Command and RecordSet objects. Currenlty our front end calls the ADODB.Command(ParamNumber).AppendChunk function passing it the binary array. Somehow, the SQL Server driver does the magic in order for the MSSQL stored procedure to work correctly. I need to know how to do one of the following:
    1. Get the Oracle driver to do the same magic.
    2. Set up the Oracle stored procedure so I don't have to change the VB front end.
    3. Change the VB front end so that it works with both MSSQL and Oracle.
    wally

  • Sample code of how to execute sql loader from visual basic

    Hi,
    Can anyone please provide me with sample code of how to
    run sql loader from inside a visual basic 6.0 application with Oracle 8.1.7.3 database or please point me to documentation/tech books containing such examples?
    Thanks very much
    John

    You have to use the command shell to activate a file.bat. The Shell command has the following parameters :
    Shell(Pathname, Windows Style )
    [email protected]
    Joel P�rez

  • 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

  • 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.

  • Error on Visual Basic 6.0 and Crystal Reports 9.2 on XP SO

    We need support to resolve an error on a system made with Visual Basic 6.x and Crystal Reports 9.2.
    Error '-2147417848 (80010108)'
    Automation Error
    Not always give these errors.
    Often occurs after request two reports followed and SO is XP
    When SO is Windows 2000 professional this error not occurs.
    These are versions of the products used:
    Versión Visual Basic:  6.0.9782
    Versión Cristal Reports:  9.2.0.448

    Hello,
    This forum is for community use and is not considered a support site. For assistance you need to purchase a case from our support site. But 9 is no longer a supported version so this is your only place to get assistance.
    Try downloading the only patches available from:
    ftp://ftp1.businessobjects.com/outgoing/CHF/cr90actxwin_en.zip
    ftp://ftp1.businessobjects.com/outgoing/CHF/cr90dbexwin_en.zip
    ftp://ftp1.businessobjects.com/outgoing/CHF/cr90devwin_en.zip
    ftp://ftp1.businessobjects.com/outgoing/CHF/cr90mainwin_en.zip
    Thank you
    Don

  • How do i use directX in microsoft visual basic studio 2010 express ?

    i am writing code to graph stock market prices using microsoft visual basic studio express
    i want fast response (i do machine language) using directX
    this is my problem
    i have never used directX, and i have never used directX in visual basic studio
    i followed a tutorial that went like this
      Reference: Microsoft.DirectX
                 Microsoft.DirectX.Direct3D
                 Microsoft.DirectX.Direct3DX
        Imports: Microsoft.DirectX
                 Microsoft.DirectX.Direct3D
                 Microsoft.DirectX.Direct3DX
        Declare: Private D3Ddev As Device = Nothing
                 Private D3Dpp As PresentParameters = Nothing
                 Private DP As DisplayMode = Nothing
    i found the reference dll's at C:\Windows\Microsoft.NET\DirectX for Managed Code\1.0.2902.0
    when i imported microsoft.directX.direct3DX i got error #1
    namespace or type specified in the imports 'microsoft.directX.direct3DX' doesn't contain any public member or cannot be found...
    the same error occurs wether i use direct3DX \1.0.2911.0 or \1.0.2902.0
    when i built and ran, i got error #2
    microsoft visual basic 2010 express is waiting for an operation to complete ...
    it hangs and i have to soft reset ctrl-alt-del
    error #3
    when i reference
      Microsoft.DirectX
      Microsoft.DirectX.Direct3D and
      Microsoft.DirectX.Direct3DX
      from C:\Windows\Microsoft.NET\DirectX for Managed Code\1.0.2902.0,
    all my declares work:
            D3Dpp = New PresentParameters()                             'Initialize
    some stuff for the Presentation parameters
            D3Dpp.BackBufferFormat = DP.Format
            D3Dpp.BackBufferWidth = DP.Width
            D3Dpp.BackBufferHeight = DP.Height
            D3Dpp.SwapEffect = SwapEffect.Discard                       'There's flip, copy, and discard. Flip and Discard
    are used most often.
            D3Dpp.PresentationInterval = PresentInterval.Immediate      'Present the scene immediately
    but when i start debugging (f5), i get this error message:
    mixed mode assembly is built against version 'v1.1.4322' of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information
    i dont fully understand the visual studio process, but i think 'mixed mode' means run and debug. two seperate app's
    i know this is a long question, but the forums don't answer it properly
    i want it answered concisly. i am running windows 7 basic, and this is my question
    can somebody give me a dozen lines of directX code that will work with my system, so that i can at least draw a line using directX 2D and 3D ?
    thanks everybody :)

    Hi,
    Thank you for your post.
    I am afraid that the issue is out of support range of VS General Question forum which mainly discusses
    WPF & SL designer, Visual Studio Guidance Automation Toolkit, Developer Documentation and Help System
    and Visual Studio Editor.
    Since your issue is related to DirectX, I suggest you consult on DirectX forum:
    http://xboxforums.create.msdn.com/forums/ for better response.
    Thanks,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for