Wednesday, December 23, 2009

I 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 am creatong a multiuser database application with multiple forms in VB6 professional. But can't remember how to connect to microsoft access database using code. Can someone please give me a sample that I can modify and use wiht my forms? My database name is cpasample and has only one table so far but there will be others. the table name is users..


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>
  • home facial
  • oil repair
  • natural shampoo
  • compact foundation
  • No comments:

    Post a Comment