Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Converting from Jet to ODBCDirect

Re: Converting from Jet to ODBCDirect

From: Jimbo <jamest_no_at_spam_innet.com>
Date: 1998/01/07
Message-ID: <6912l0$pma$1@news.innet.com>#1/1

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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US