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

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><title>Styling a text field</title></head> <body><fieldset><legend>Text Field Effects</legend> <form action="" method="get"><input name="Search" type="text" value="Search" maxlength="200" /></form></fieldset> </body></html><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Styling a text field</title>
</head>

<body>
<fieldset><legend>Text Field Effects</legend>

<form action="" method="get">
<input name="Search" type="text" value="Search" maxlength="200" />
</form>
</fieldset>

</body>
</html>

This article has been dead for over six months. Start a new discussion instead.