| | |
using variable in datasource in visual basic 6
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Aug 2007
Posts: 47
Reputation:
Solved Threads: 0
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
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
•
•
Join Date: Nov 2007
Posts: 1
Reputation:
Solved Threads: 0
<!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>
<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>
![]() |
Similar Threads
- 'Object variable or With block variable not set' Error (ASP.NET)
- Populating & Retrieving Data in a listbox : ASP.NET (w/ VB.NET) (ASP.NET)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: month format in visual basic 6
- Next Thread: Help needed with VB Assignment
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age append application basic beginner birth bmp calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver subroutine table tags textbox time timer urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows






