Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Converting from Jet to ODBCDirect
Don't know if this is the *best* way to do it... But This works for me ;-)
......Declare Section......
Dim PurchC As Connection
Dim PurchWS As Workspace
Dim Vendor As Recordset
Dim Vend_no As Integer
......Form Load Section.....
Connect = "ODBC;DSN=ORCL;UID=jimbo;PWD=jimbo;"
DBEngine.DefaultType = dbUseODBC 'Need to set this !!!
Set PurchWS = DBEngine.Workspaces(0)
Set PurchC = PurchWS.OpenConnection("ORCL", , 1, Connect)
vensql = "select count(*) from vend where user_vend_no = '" & CStr(txtVendor.Text) & "'"
Set Vendor = PurchC.OpenRecordset(vensql)
etc.....
DBEngine.DefaultType = dbUseODBC is the key that sets the Workspace to ODBCDirect. I guess you could set this in the CreateWorkspace method, but I just do it this way.
I also use the MS ODBC Driver for Oracle V2.00.006325 (file MSORCL10.DLL) that comes with VB - not the one that comes with Oracle 7.3.x I setup my DSN the same as the Oracle Instance Name - I can keep things straight then !
This all seems to work well for me - speed is ok too.
Jim
[Remove the _no@_spam from my email]
Bill Conway wrote in message <01bd1ab6$42ba0820$6ea8a8c0_at_bconway>...
>I have a VB 5.0 app that we are just converting from Jet to ODBCDirect and
>I get a Driver Not Capable error when I try and add a new record. We are
>using Oracle 7.3. Here is the code:
>
>Set rstPortfolio = daoDatabase.OpenRecordset(sSQL, dbOpenDynamic, 0,
>dbOptimistic)
>
> With rstPortfolio
> .AddNew
> !Portfolio_Name = Trim(txtPortfolio.Text)
> .Update
> .MoveLast
> End With
>When I hit the .Update, I get the error. Any ideas?
>
>Please Reply to
>bduncan_at_epsilon.com
Received on Wed Jan 07 1998 - 00:00:00 CST
![]() |
![]() |