Greetings!
Im using this format to use and open database
Set ac = New ADODB.Connection
Set ar = New ADODB.Recordset
strconek = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\record.mdb;Persist Security Info=False"
i want to use variable value in my data source.
my database is record.mdb. i want to make syntax for this that replace the data source value or the database that i want to use database depend on my given filename..
for example my databasefilename is "file.mdb". Then, my strconek value also change in this format
if the database file is not existing. I want to copy other database to use in my program and to avoid error..
for example : my filename is "file.mdb" first is check this database from the original path or drive. if this filename or database not found. I want to copy the existing database in this filename "copy the file record.mdb to file.mdb"
strconek = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & App.Path & "\file.mdb;Persist Security Info=False"
'same routine
if i give another database filename then my strconek value in the datasource also change..
but first is to check the file if existing or not. if existing open the file. if not copy the other database to this filename..
in this case my "strconek" value is okey..
thanks in advance