visual basic 6.0 to ms access

linking database to visual basic 6.0

Page 1 of 1

5 Replies - 29073 Views - Last Post: 17 August 2010 - 12:19 PM Rate Topic: -----

#1 paler_pinky  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 1
  • Joined: 07-August 10

visual basic 6.0 to ms access

Posted 07 August 2010 - 10:28 AM

how to link my program to my database? i'm using ms access 2003 and visual basic 6.0
Is This A Good Question/Topic? 2
  • +

Replies To: visual basic 6.0 to ms access

#2 macosxnerd101  Icon User is offline

  • Self-Trained Economist
  • member icon




Reputation: 10805
  • View blog
  • Posts: 40,278
  • Joined: 27-December 08

Re: visual basic 6.0 to ms access

Posted 07 August 2010 - 01:51 PM

Moved to VB6 Help from VB6 Tutorials.
Was This Post Helpful? 0
  • +
  • -

#3 guyfromri  Icon User is offline

  • D.I.C Addict

Reputation: 46
  • View blog
  • Posts: 826
  • Joined: 16-September 09

Re: visual basic 6.0 to ms access

Posted 07 August 2010 - 05:41 PM

We need more information...what does your program do? Is it meant to do something within access or open access from the outside? Do you have code written?
Was This Post Helpful? 0
  • +
  • -

#4 Guest_M.Yunus AKDAĞ*


Reputation:

Re: visual basic 6.0 to ms access

Posted 11 August 2010 - 11:11 AM

Set conn = CreateObject("ADODB.Connection")
conn.open "Driver={Mcrosoft Access Driver (*.mdb)} ;Dbq=C:\Users\USER\Documents\database.mdb"

Set query = conn.Execute("SQL COMMAND")
'or
Set rs = CreateObject("ADODB.RecordSet")
rs.open "SQL COMMAND",conn,1,3
' if you use this you can use rs.AddNew,rs.PageSize/count/absolutepage ...


Was This Post Helpful? 0

#5 Kinwang2009  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 76
  • Joined: 07-February 10

Re: visual basic 6.0 to ms access

Posted 11 August 2010 - 09:02 PM

View Postpaler_pinky, on 07 August 2010 - 09:28 AM, said:

how to link my program to my database? i'm using ms access 2003 and visual basic 6.0

See my attached Help

Attached File(s)


Was This Post Helpful? 0
  • +
  • -

#6 kingsonprisonic  Icon User is offline

  • D.I.C Head

Reputation: 9
  • View blog
  • Posts: 74
  • Joined: 09-July 09

Re: visual basic 6.0 to ms access

Posted 17 August 2010 - 12:19 PM

Another methode for accessing Access Database Using VB 6.0


First view this document DOWNLOAD


After view this file please follow this code......

Dim db As Database
Dim rs As Recordset



Private Sub Form_Load()
Set db = OpenDatabase("Your Database Physical Path") ' Use App.Path
Set rs = db.OpenRecordset("Table Name or Sql Query")


'Now Access the fields of that table directly



rs!fieldname = ""
something = rs!fieldname


'If you want to search all record just use a do until loop


Do Until rs.EOF

'here you can access fields

MsgBox (rs!fieldname)


rs.MoveNext
Loop


'Last of all this is an example so try it with real database path and a table........


' Thank you..!

End Sub



If you have any problem just Email me
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1