jayson_13
September 13th, 2002, 12:12 AM
i need to connect to paradox database version 5 i think.
my comp had map a drive to the server so i can use the corel paradox program so i can insert data into db which resides in the same drive. now i wan to retrieve data from one of the table called drs.db but got error occur.
i used the odbc.net dloaded from ms website and have mdac2.7 installed on my computer. following is my code:
Imports Microsoft.Data.Odbc
Dim mySelectQuery As String = "SELECT * FROM DRS"
Dim myConnString = "Driver={Microsoft Paradox Drive(*.db)};DriverID=538;Fil=Paradox5.X;
DefaultDir=Q:\CIMBASE\SALEBASE\DRS.DB;
Dbq=Q:\CIMBASE\SALEBASE;
CollatingSequence=ASCII;"
Dim myConnection As New OdbcConnection(myConnString)
Dim myCommand As New OdbcCommand(mySelectQuery,myConnection)
Try
myConnection.Open()
Catch
MsgBox(Err.Source)
MsgBox(Err.Description)
Exit Sub
End Try
Dim myReader As OdbcDataReader = myCommand.ExecuteReader()
Try
While myReader.Read()
MsgBox(myReader.GetString(2))
End While
Finally
myReader.Close()
myConnection.Close()
End Try
End Sub
the error i get is:
Data source name not found or no default driver specified
my comp had map a drive to the server so i can use the corel paradox program so i can insert data into db which resides in the same drive. now i wan to retrieve data from one of the table called drs.db but got error occur.
i used the odbc.net dloaded from ms website and have mdac2.7 installed on my computer. following is my code:
Imports Microsoft.Data.Odbc
Dim mySelectQuery As String = "SELECT * FROM DRS"
Dim myConnString = "Driver={Microsoft Paradox Drive(*.db)};DriverID=538;Fil=Paradox5.X;
DefaultDir=Q:\CIMBASE\SALEBASE\DRS.DB;
Dbq=Q:\CIMBASE\SALEBASE;
CollatingSequence=ASCII;"
Dim myConnection As New OdbcConnection(myConnString)
Dim myCommand As New OdbcCommand(mySelectQuery,myConnection)
Try
myConnection.Open()
Catch
MsgBox(Err.Source)
MsgBox(Err.Description)
Exit Sub
End Try
Dim myReader As OdbcDataReader = myCommand.ExecuteReader()
Try
While myReader.Read()
MsgBox(myReader.GetString(2))
End While
Finally
myReader.Close()
myConnection.Close()
End Try
End Sub
the error i get is:
Data source name not found or no default driver specified