Vb.6 & Ms, Access Help...

Submitted by: 
Visitors have accessed this post 5168 times.

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

can you pls help me how to made a voting system using visual basic 6.0

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
  4. !Field1 = txtLastname.text
  5. !Field1 = txtFirstname.text
  7. .update
  8. end with

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

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <th> <img> <h1> <h2> <h3> <iframe>
  • You may insert videos with [video:URL]
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <asp>, <c>, <cpp>, <csharp>, <css>, <html4strict>, <java>, <javascript>, <mysql>, <php>, <python>, <sql>, <vb>, <vbnet>. The supported tag styles are: <foo>, [foo].
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.