Re: VB and Oracle ODBC
Date: 1996/10/02
Message-ID: <52tq1c$q40_at_tomcat.msrcnavo.navy.mil>#1/1
I find that there are a couple of common mistakes in this situation.
- are you absolutely sure that the sql is valid...have you acutally set a breakpoint in the code ..printed out the sql before it was executed then cut and paste it into sql plus to make sure that you are executing the same code.
- are you sure the connect paramters for you database object are the same as when you log onto sql plus ( check not only your logon name and password but your ODBC datasorce as well.
Jason
wangsong <wangs_at_cyberway.com.sg> wrote:
>Hi, there
>I'm now using VB 4.0 pro to access Oracle database through ODBC and encounter following problems. I would be very grateful if you
>could shed any light on these problems.
>1. I try to import a local text file into Oracle table. the way I do it is as following .
>
> Do until EOF( fileNum )
> line Input #fileNum, nextLine
> sql = FormMyInsertStatement(nextLine)
> db.Excute sql, dbSqlPassThrough
> Loop
> In the loop, I inconsitently get the error code 3146 which mean "ODBC call failed". checked the SQL statement which
> cause problem, I found it is a normal statement and works well when I run this statement in SQL PLUS.
> I try to bypass this problem by using DAO method as following
>
> Dim field1 as string, field2 as string
> Do until EOF( fileNum )
> line Input #fileNum, nextLine
> field1 = GetField(nextLine,1) 'function to seperate the nextline into fields
> field2 = GetField(nextLine, 2)
> db.recordset.addnew
> db.recordset("field1") = field1
> db.recordset("field2") = field2
> db.recordset.update
> Loop
> Unfortunatly, I still inconsitently get the error 3146. I have tried these two method with MS SQl Server, they works fine.
> What might be the reason behind. is it caused by VB or Oracle ODBC driver?
>
>2.
>Sometimes, following a failed odbc call, I get this error message: "The Jet VBA file(VBAJET.DLL for 16-bit versions, or
>VBAJET32.DLL for 32-bit versions) is missing. Try reinstalling the application that returned the error ". After relaunching the Visual
>Basic,
>it seems OK. What does this message ecxatly mean. When I use MS SQL Server ODBC driver, I never get this message.
Received on Wed Oct 02 1996 - 00:00:00 CEST