jonnyfive
asked on
Fast answer needed!
Hi everyone...
I need a fast answer to the following problem:
I want to connect to a Paradox database using the TADOQuery component. I have to provide a connection string, but I can't figure out what I have to put in there. The only specification is, that I can not use a predefined DSN, since I must be able to specify the driver (and all other data) manually.
Any help?
Jonny..
I need a fast answer to the following problem:
I want to connect to a Paradox database using the TADOQuery component. I have to provide a connection string, but I can't figure out what I have to put in there. The only specification is, that I can not use a predefined DSN, since I must be able to specify the driver (and all other data) manually.
Any help?
Jonny..
ASKER
Hi Motaz...
Sorry, you're wrong about that. If I provide a DSN, it works just fine. But I want to prevent providing a DSN, since all our products using BDE and we only start to use ADO. This would mean, that we have to install a additional DSN on all client machines, which I want to prevent. Another solution I can accept, if someone knows how to create a DSN from Delphi.
Regards, Jonny...
Sorry, you're wrong about that. If I provide a DSN, it works just fine. But I want to prevent providing a DSN, since all our products using BDE and we only start to use ADO. This would mean, that we have to install a additional DSN on all client machines, which I want to prevent. Another solution I can accept, if someone knows how to create a DSN from Delphi.
Regards, Jonny...
ASKER
Hi Motaz...
Sorry, you're wrong about that. If I provide a DSN, it works just fine. But I want to prevent providing a DSN, since all our products using BDE and we only start to use ADO. This would mean, that we have to install a additional DSN on all client machines, which I want to prevent. Another solution I can accept, if someone knows how to create a DSN from Delphi.
Regards, Jonny...
Sorry, you're wrong about that. If I provide a DSN, it works just fine. But I want to prevent providing a DSN, since all our products using BDE and we only start to use ADO. This would mean, that we have to install a additional DSN on all client machines, which I want to prevent. Another solution I can accept, if someone knows how to create a DSN from Delphi.
Regards, Jonny...
jonnyfive.... just like a suggestion, why don´t you install the DSN from Delphi when the application doesn´t find it ?
I did that in the past with a DSN of a ODBC driver for Sybase.
You can Use RegEdit from Delphi to write the apropiates instances and keys params (like the driver path) and it´s just works equally as if you installed the DSN...
If you want to know more about it... let me know and I can provide the code I used.
NetoMan :)
I did that in the past with a DSN of a ODBC driver for Sybase.
You can Use RegEdit from Delphi to write the apropiates instances and keys params (like the driver path) and it´s just works equally as if you installed the DSN...
If you want to know more about it... let me know and I can provide the code I used.
NetoMan :)
The simplest answer ain't so simple...but here goes.
Create a FileDSN that points to your database, now you can ship the *.dsn file you just created with your software and access it like so...
Provider=MSDASQL.1;Persist Security Info=False;Extended Properties="CollatingSeque nce=ASCII; DBQ=H:\PRO GRAM FILES\COMMON FILES\BORLAND SHARED\DATA;DefaultDir=H:\ PROGRAM FILES\COMMON FILES\BORLAND SHARED\DATA;Driver={Micros oft Paradox Driver (*.db )};DriverId=538;FIL=Parado x 5.X;FILEDSN=H:\Program Files\Common Files\ODBC\Data Sources\Paradox.dsn;"
or
you can open it (the *.dsn file) with a text editor and delete the
[ODBC]
from the top line, then concatenate all the lines together seperated by semi-colons and insert them into a connection string like this...
Provider=MSDASQL.1;Persist Security Info=False;Extended Properties="CollatingSeque nce=ASCII; DBQ=H:\PRO GRAM FILES\COMMON FILES\BORLAND SHARED\DATA;DefaultDir=H:\ PROGRAM FILES\COMMON FILES\BORLAND SHARED\DATA;Driver={Micros oft Paradox Driver (*.db )};DriverId=538;FIL=Parado x 5.X;MaxBufferSize=2048;Max ScanRows=8 ;PageTimeo ut=5;Parad oxNetPath= H:\WINNT\S ystem32;Pa radoxNetSt yle=3.x;Pa radoxUserN ame=admin; SafeTransa ctions=0;T hreads=3;U ID=admin;U serCommitS ync=Yes;"
hope this gives you an idea
regards
l8knight
Create a FileDSN that points to your database, now you can ship the *.dsn file you just created with your software and access it like so...
Provider=MSDASQL.1;Persist
or
you can open it (the *.dsn file) with a text editor and delete the
[ODBC]
from the top line, then concatenate all the lines together seperated by semi-colons and insert them into a connection string like this...
Provider=MSDASQL.1;Persist
hope this gives you an idea
regards
l8knight
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
following
l8knight, As you say you are new:
The philosophy here at e.e. is always post answers or suggestions as a comment because that will not block the question to other experts that maybe will have a better answer (like you). And then the people who ask will have several alternatives to resolve his problem and decide was the best alternative to him. (he can Accept a comment like if was a Answer).
So welcome!!!!
NetoMan :)
The philosophy here at e.e. is always post answers or suggestions as a comment because that will not block the question to other experts that maybe will have a better answer (like you). And then the people who ask will have several alternatives to resolve his problem and decide was the best alternative to him. (he can Accept a comment like if was a Answer).
So welcome!!!!
NetoMan :)
thankyou for your comments Netoman, I will abide by the e.e. philosophy from now on. :)
regards
l8knight
regards
l8knight
I didn't think that ADO can wotk with Paradox, because ADO is a Microsoft's and Microsoft didn't know Paradox.
Motaz