Thank you for any help you can give meI am using vb6 prof. i want to create an mdi that will have a login but I can't remember the coding for this.?
I wrote this simple program to help someone online here. It'll give you the basics of how to connect.
Const DBNAME = ';c:\customer.mdb';
Set objFSOA = CreateObject(';Scripting.FileSystemObject鈥?br>
If not objFSOA.FileExists(DBNAME) Then
CreateDatabase
End if
Set objConnectionA = CreateObject(';ADODB.Connection';)
objConnectionA.Open ';Provider= Microsoft.Jet.OLEDB.4.0; '; %26amp; ';Data Source= '; %26amp; DBNAME
Dim strSQL
strSQL = ';INSERT INTO Test(col_1, col_2) VALUES (23, 'Test');';
objConnectionA.Execute(strSQL)
objConnectionA.Close
Private Sub CreateDatabase()
Dim objADOXDatabase
Set objADOXDatabase = CreateObject(';ADOX.Catalog';)
objADOXDatabase.Create ';Provider=Microsoft.Jet.OLEDB.4.0;'; %26amp; ';Data Source='; %26amp; DBNAME
Set objConnectionA = CreateObject(';ADODB.Connection';)
objConnectionA.Open ';Provider= Microsoft.Jet.OLEDB.4.0; '; %26amp; ';Data Source= '; %26amp; DBNAME
objConnectionA.Execute ';Create Table Test(col_1 number, col_2 text(10))';
objConnectionA.Close
End Sub
To open with a password use:
oConn.Open ';Provider=Microsoft.Jet.OLEDB.4.0;'; %26amp; _ ';Data Source=c:\somepath\mydb.mdb;'; %26amp; _ ';Jet OLEDB:Database Password=MyDbPassword';, _ txtUser.text, txtPassword.textI am using vb6 prof. i want to create an mdi that will have a login but I can't remember the coding for this.?
http://answers.yahoo.com/question/index;鈥?/a>
No comments:
Post a Comment