PDA

Click to See Complete Forum and Search --> : AppPath With ADO


Rev. Michael L. Burns
Feb 17th, 2000, 09:44 PM
Most of the VB Databases that I have created and worked with were done in VB4 and VB5. I'd like to begin using VB6,ADO and the DataReports. I'd like to use AppPath so that the database file can be found whereever I install the application. Is it possible to use AppPath with ADO and DataReportss?

Thanks, Rev. Michael L. Burns

SteFlitII
Feb 17th, 2000, 10:12 PM
Why not create a app class object that stores all path information, database connection and generally application global information that gets created at startup. this way you can simply reference g_app.appname or g_app.localconnection etc
Or store your path information in the registry instead of hard coding it

Rev. Michael L. Burns
Feb 17th, 2000, 10:22 PM
Thanks for the food for thought. Never thought of trying it this way. Learn something new everyday.

Rev. Michael L. Burns

Chris
Feb 21st, 2000, 12:33 AM
I found that the Database path in the DataEnvironment can be change redefine the connectionString at the procedure before you show the dataReport as below:

'Set the DB Path for the Data Environment Object in runtime..
WithDataEnvironment1.Connections.Item(<Your Connection Name> )
.ConnectionString = "Provider=MSDataShape.1;Extended Properties=" & "Jet OLEDB :Database Password=<Your Password Here, If you have it>" & _
";Persist Security Info=False;Connect Timeout=15;Data Source=" & _
"<Your Database path Here, Detect/Set with App.path at runtime>" & _
";Data Provider=MICROSOFT.JET.OLEDB.4.0"

End With

------------------
A free Man stand on a free Land.
ccthou@yahoo.com

shachar
Feb 22nd, 2000, 02:31 AM
ofcourse you can !
and dont forget to add to the chris's great answe that you can use an ini file and with an api you can read text from it and then change the string as you like for each p.c

api:GETPROFILESTRING

------------------
shachar shaty
israel