E
Earl
Maaaaaaaaaan ... nothing but drama with ODBC and .Net.
On my development system, using the code below, I can successfully open/read
an Act.dbf file. I can successfull do this either in debug mode or simply
running the program.exe.
However, on the user systems, I get the error:
"Error [IM002] Microsoft [ODBC Driver Manager] Data Source name not found
and no default driver specified."
(Note that ActDBSource is the path that comes in from a class where it has
been set by the user and ActDBName is simply the split/parsed value of name
only, 'i.e., Your.Dbf.) Not only have I examined both of those strings, but
they also work properly on the development system, thus I do not believe
either is an issue.)
On my test systems where this is failing, I do have the DSN for Visual
FoxPro Tables. If this is a system issue, I'm scratching my head on what's
not configured properly.
'***************************************
Imports System
Imports System.Data.Odbc
Dim connAct As New Odbc.OdbcConnection
connAct.ConnectionString = "PWD=;SourceType=DBF;DSN=Visual FoxPro Tables;" &
_
"Collate=Machine;BackgroundFetch=Yes;Exclusive=No;" & _
"SourceDB=" & ActDbSource & ";" & _
"UID="
Dim strProspectSelect As String = "Select
Name,Home_Phone,Fname,LName,Unique_ID FROM " & "[" & ActDbName & "]"
Dim cmdProspects As New OdbcCommand(strProspectSelect, connAct)
Dim dr As OdbcDataReader
connAct.Open()
dr = cmdProspects.ExecuteReader()
On my development system, using the code below, I can successfully open/read
an Act.dbf file. I can successfull do this either in debug mode or simply
running the program.exe.
However, on the user systems, I get the error:
"Error [IM002] Microsoft [ODBC Driver Manager] Data Source name not found
and no default driver specified."
(Note that ActDBSource is the path that comes in from a class where it has
been set by the user and ActDBName is simply the split/parsed value of name
only, 'i.e., Your.Dbf.) Not only have I examined both of those strings, but
they also work properly on the development system, thus I do not believe
either is an issue.)
On my test systems where this is failing, I do have the DSN for Visual
FoxPro Tables. If this is a system issue, I'm scratching my head on what's
not configured properly.
'***************************************
Imports System
Imports System.Data.Odbc
Dim connAct As New Odbc.OdbcConnection
connAct.ConnectionString = "PWD=;SourceType=DBF;DSN=Visual FoxPro Tables;" &
_
"Collate=Machine;BackgroundFetch=Yes;Exclusive=No;" & _
"SourceDB=" & ActDbSource & ";" & _
"UID="
Dim strProspectSelect As String = "Select
Name,Home_Phone,Fname,LName,Unique_ID FROM " & "[" & ActDbName & "]"
Dim cmdProspects As New OdbcCommand(strProspectSelect, connAct)
Dim dr As OdbcDataReader
connAct.Open()
dr = cmdProspects.ExecuteReader()