
Using dBase IV with VB via ODBC without a DSN
I am trying to determine the correct code to create a connection to dBASE
files using VB via ODBC without first having to set up a DSN connection (of
which 9 would be required for this app). Although I have code that works
with pre-defined connections, I don't want to force users to have to
correctly name and create 9 connections for each machine!
For example, I am trying to connect to a dBase file named Nodes.dbf in the
C:\CIPS\SHAPEFILES\ directory. I currently use the following code, but am
trying to determine to correct connect string to avoid the DSN problem:
Dim ADONode As New ADODB.Connection
Dim adoNodeRS As Recordset
ADONode.CursorLocation = adUseClient ADONode.Open
"PROVIDER=MSDASQL;dsn=nodes.dbf;uid=;pwd=;" Set adoNodeRS = New Recordset
adoNodeRS.Open "select
APOID,AP_LOCATIO,BASE_ABBR,BLDG,FLOOR,ROOM,NODE_TOPO_,IP_HOSTNAM,AP_FORMAT
from NODES", ADONode, adOpenStatic, adLockOptimistic
Etc, etc.
Thanks in advance...
Bryan
Sent via Deja.com http://www.*-*-*.com/
Before you buy.