ReverseSt4r
The real Scribe.
Hey guys,
I'm in yr11 and I'm having trouble with an assessment task. We need to create a software solution in Visual Basic 6.0, and I've decided to make a database which displays information on a (pretend) CD store's sales and inventory details. The database will then open in a VB6 form.
I set up the table in the database with all the info I want, and then I made the form, and put in the following code:
---
Dim rsVIEW As Recordset
Dim dbVIEW As Database
---
Private Sub Form_Load()
Set dbVIEW = OpenDatabase("C:\Documents and Settings\Owner\My Documents\SDD Major Project\AXIS\DATABASE\db1.mdb")
Set rsVIEW = dbVIEW.OpenRecordset("Table1", dbOpenDynaset)
If Not rsVIEW.EOF Then rsVIEW.MoveFirst
Do While Not rsVIEW.EOF
lst_Records.AddItem rsVIEW!Name
lst_Records.ItemData(lst_Records.NewIndex) = rsVIEW!ID
rsVIEW.MoveNext
Loop
End Sub
---
The program is supposed to fill up listbox "lst_Records" with the records from the table. But whenever I run the program, VB has a tantrum and says:
---
Run-time error '3343':
Unrecognized database format 'C:\Documents and Settings\Owner\My Documents\SDD Major Project\AXIS\DATABASE\db1.mdb'.
---
What do I do? Can you guys help?
~ReverseSt4r
I'm in yr11 and I'm having trouble with an assessment task. We need to create a software solution in Visual Basic 6.0, and I've decided to make a database which displays information on a (pretend) CD store's sales and inventory details. The database will then open in a VB6 form.
I set up the table in the database with all the info I want, and then I made the form, and put in the following code:
---
Dim rsVIEW As Recordset
Dim dbVIEW As Database
---
Private Sub Form_Load()
Set dbVIEW = OpenDatabase("C:\Documents and Settings\Owner\My Documents\SDD Major Project\AXIS\DATABASE\db1.mdb")
Set rsVIEW = dbVIEW.OpenRecordset("Table1", dbOpenDynaset)
If Not rsVIEW.EOF Then rsVIEW.MoveFirst
Do While Not rsVIEW.EOF
lst_Records.AddItem rsVIEW!Name
lst_Records.ItemData(lst_Records.NewIndex) = rsVIEW!ID
rsVIEW.MoveNext
Loop
End Sub
---
The program is supposed to fill up listbox "lst_Records" with the records from the table. But whenever I run the program, VB has a tantrum and says:
---
Run-time error '3343':
Unrecognized database format 'C:\Documents and Settings\Owner\My Documents\SDD Major Project\AXIS\DATABASE\db1.mdb'.
---
What do I do? Can you guys help?
~ReverseSt4r