HP3000-L Archives

May 2000, Week 4

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Reply To:
Date:
Wed, 24 May 2000 16:23:02 GMT
Content-Type:
text/plain
Parts/Attachments:
text/plain (86 lines)
It is a Microsoft thing ... Every version of Visual Basic has had differences
in the way ODBC was called, starting with DAOs, changing to RDO, and lately
there have been several versions of the ADO (ActiveX Data Objects)

Here is a tech note which explains the issue:

Connecting with Microsoft DAO Compatibility Library 2.5/3.51

Microsoft has changed the methodology of connecting in different DAO versions.
This method works fine with Microsoft DAO Compatibility Library 2.5/3.51.  For
each DAO library Microsoft has changed the members and properties a certain
amount, so the connection that you could use with one library will more that
likely not work with other DAO libraries


1 DECLARE YOUR VARIABLES FOR THE CONNECTION
2 SET THE DAO WORKSPACE
3 SET AND OPEN THE CONNECTION TO THE DATABASE
4 SET AND OPEN THE RECORDSET FOR THE TABLE
5 USE THE RECORDSET  INFORMATION YOU NEED AND PROCESS IT
   OCORDINGLY
6 MAKE SURE YOU CLOSE ANY ODJECTS THAT YOU HAVE CREATED
   WHEN ERRORS OCCUR(OR WHEN EXITING)


1       Dim DAOWS As DAO.Workspace
Dim DAORS As DAO.Recordset
Dim DAODB As DAO.Database

2       'SET A WORKSPACE ENVIROMENT FOR YOUR CONNECTION
        'AND SET THE TYPE TO DBUSEODBC
        'Set DAOWS = CreateWorkspace("NewODBCWorkspace", "", "", dbUseODBC)

3       'OPEN THE CONNECTION PASS IN YOU CONNECTION STRING
'Set DAODB = Workspaces(0).OpenDatabase("", dbDriverComplete, True,
"ODBC;DSN=YOURDSN;UID=YOURUID;PWD=YOURPASSWORD;")

4       'OPEN THE TABLE AND ENTER THE SQL QUERY
'Set DAORS = DAODB.OpenRecordset("SELECT * FROM YOURTABLE;", dbOpenDynaset,
dbSQLPassThrough)

5       While Not DAORS.EOF
                ' Insert your query processing code here.
                DAORS.MoveNext
        Wend

6       ‘Close Resultset
        DAORS.Close
        'Close Data Base Connection
        DAODB.Close




In article <[log in to unmask]>, "Rexor" <[log in to unmask]> writes:

>
>We tried the ODBC driver from our HP3000 to access to TurboImage databases .
>(MPE 5.5 has the ODBCLN/SE driver)
>This works with ACCESS 97/2000 and we use it every day.
>
>We don't want to install Microsoft ACCESS to all users.
>That's why we want to use VISUAL BASIC 6.0 to create some applications.
>
>We can't access databases with Visual Basic and ODBC driver.
>
>Can someone send us a code example, for the "OpenDatabase" with this ODBC
>driver?
>
>Our Problem for example:
>    - Dim wrkjet as workspace    //     this works only with Access I think
>    - Dim dbspubs as database    //    the system doesn't recognize
>WORKSPACE and DATABASE type???
>Best Regards,
>                            Fabien Visini
>

Hope this helps,


Birket Foster
M. B. Foster Associates .. the 1-800-ANSWERS people!
Supplying DataExpress w/cross-platform ODBCLink Option ( 3000,9000&NT)
EC/EDI(3000,9000,NT) Phone (613) 448-2333 or (613) 448-2588 (FAX)
(See our website at http://WWW.MBFoster.com )

ATOM RSS1 RSS2