Bill,
You can - of course - point to the file using MapBasic. The trick is to know
the syntax ;-)
'*******************************
Function ODBCOpenConnection() As Integer
Dim nConnection As Integer,
szConnectionStr, szToolKitStr As String
OnError GoTo ErrorOccured
ODBCOpenConnection = 0
szConnectionStr = "FILEDSN=" & ApplicationDirectory$() & "SPVector.dsn"
szToolKitStr = "ODBC"
nConnection = Server_Connect(szToolKitStr,
szConnectionStr)
If nConnection = 0 Then
Note "Was not able to connect to MS ACCESS using (" &
ApplicationDirectory$() & "SPVector.dsn)!"
Exit Function
End If
ODBCOpenConnection = nConnection
Exit Function
'-------------------------
ErrorOccured:
Note "ODBCOpenConnection: Error connecting to database!"
End Function
'*******************************
And you can add extra parameters to the connection string as specified in the
help file
HTH,
Peter Horsb�ll M�ller
GIS Developer
Geographical Information & IT
COWI A/S
Odensevej 95
DK-5260 Odense S.
Denmark
Tel +45 6311 4900
Direct +45 6311 4908
Mob +45 5156 1045
Fax +45 6311 4949
E-mail [EMAIL PROTECTED]
http://www.cowi.dk/gis
-----Original Message-----
From: Bill Thoen [mailto:[EMAIL PROTECTED]
Sent: Monday, May 30, 2005 6:28 PM
To: MapInfo-L
Subject: MI-L Server_Connect Using a *.dsn file
Does anyone know how (in MapBasic) I can open an ODBC connection to a
table using a previously defined DSN file? Do I have to open it manually
and use the contents in the Server_Connect() DSN string, or is there a way
to simply point to the file and have MapInfo read the contents and open
the data source?
- Bill Thoen
---------------------------------------------------------------------
List hosting provided by Directions Magazine | www.directionsmag.com | To
unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Message number: 16600