Vb.6 & Ms, Access Help...

Hi...Everyone I am new to this community I have noticed that here all the quries are resolved systamatically seeing this I have also asked my friends to join it..I have a query and this is my 1st one so hope for a best reply,I want to insert the data in Ms Access through code using in vb6. Could I, get a best asvise for it.Tahnks,I am deliberatly seeking for the replies.

Dim ws As Workspace Dim db As Database Dim rs As Recordset Private Sub Command1_Click() Set ws = DBEngine.Workspaces(0) Set db = ws.OpenDatabase("Myaccessfile.mdb") Set rs = db.OpenRecordset("Table1", dbOpenTable) End Sub ' where as Myaccessfile.mdb -> is File name, Table1 is the table name

You are using the old way (DAO) of connecting to a database. ADO is the new technology to connect to a database. Anyway you can do this the same with ADO:
  1. with rs
  2.      .addnew
  3.  
  4.      !Field1 = txtLastname.text
  5.      !Field1 = txtFirstname.text
  6.  
  7.      .update
  8. end with

Please let me know how to print a bill using printer in Vb6

Add new comment