Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ODBC connection to paradox database

Status
Not open for further replies.

pilbeam

IS-IT--Management
Sep 13, 2001
2
GB
I am using the following code in VB6 to try to get an ODBC connection to a paradox database:

Dim wrk As Workspace
Dim db As Database
Dim co As Connection
Dim rs As Recordset
'
'
' establish ODBC connection
Set wrk = CreateWorkspace("wrk", "admin", "", dbUseODBC)
Set co = wrk.OpenConnection("ODBC;DSN=Paradox;DATABASE=f:\drs\order\ordr.db;UID=sa;PWD=""")
Set db = wrk.OpenDatabase("f:\drs\order\ordr.db", "wrk", "ODBC;DSN=Paradox;DATABASE=f:\drs\order\ordr.db;UID=sa;PWD=""")

Set rs = co_OpenRecordset("SELECT * FROM Ordr", dbOpenForwardOnly)
'
'

The code fails on the line "Set db" with the error 3421 'data type conversion error'

Having achieved the connection, I then want to run sqls on the recordset.

What am I doing wrong?
 
I may be wrong but I understood that the Borland database engine has to be running to translate the field types for the ODBC driver.What version of Paradox are you using?
 
I use VB and PAradox and the connection does have be passed through Borlands own database engine.
You have to setup a System DSN and connect via that. But it means that regular SQL expression don't always work. Like date formats for instance are a little weird. My workaround was to use an Access database as an intermediary, with all the Paradox tables shown as linked tables in the Access database.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top