I have a VB6 program using an ACCESS database. I have created an EXE and a SETUP package that includes all .OCX files, database, images and EXE. I installed the program on the clients machine but only part of it works. I opened the code on my home machine and the .EDIT action is not present.
My References are:
Visual Basic For Applications
Visual Basic runtime objects and procedures
Visual Basic objects and procedures
OLE Automation
Microsoft DAO 3.6 Object Library
Microsoft Data Formatting Object Library 6.0(SP4)
Microsoft ActiveX Data Objects 2.5 Library
Microsoft Data Binding Collection VB 6.0 (SP4)
Microsoft Access 11.0 Object Library
Microsoft ADO Ext.2.8 for DLL and Security
My Components are:
Microsoft ADO Data Control 6.0 (SP4) (OLEDB)
Microsoft Calendar Control 11.0
Microsoft Data Bound List Controls 6.0
Microsoft DataGrid Control 6.0 (SP5) (OLEDB)
In a module, I put the connection to the database.
Function MakeConnection()
Set db = OpenDatabase("C:\Program Files\Pick of the Litter\PickOfTheLitter.mdb")
End Function
I can't get past the Form_Load event. The error happens at the .EDIT line. When I use intelesense .EDIT is not available, only .EDITMode is. I don't understand this since I have VB6 on both machines (work and home) they are both running Windows XP and use Microsoft Office 2003.
Private Sub Form_Load()
Today = Format(Now, "Short Date")
MakeConnection
Dim diff As Integer
'//Update the pets ages
Set rs = db.OpenRecordset("select * from pets")
With rs
Do While Not rs.EOF
diff = DateDiff("d", !AgeDate, Today)
If DateDiff("d", Today, !AgeDate) >= 365 Then
.Edit
!Age = !Age + 1
!AgeDate = Today
.Update
.MoveNext
Else
.MoveNext
End If
Loop
End With
rs.Close
db.Close
FillColorCombo
FillType
End Sub
My References are:
Visual Basic For Applications
Visual Basic runtime objects and procedures
Visual Basic objects and procedures
OLE Automation
Microsoft DAO 3.6 Object Library
Microsoft Data Formatting Object Library 6.0(SP4)
Microsoft ActiveX Data Objects 2.5 Library
Microsoft Data Binding Collection VB 6.0 (SP4)
Microsoft Access 11.0 Object Library
Microsoft ADO Ext.2.8 for DLL and Security
My Components are:
Microsoft ADO Data Control 6.0 (SP4) (OLEDB)
Microsoft Calendar Control 11.0
Microsoft Data Bound List Controls 6.0
Microsoft DataGrid Control 6.0 (SP5) (OLEDB)
In a module, I put the connection to the database.
Function MakeConnection()
Set db = OpenDatabase("C:\Program Files\Pick of the Litter\PickOfTheLitter.mdb")
End Function
I can't get past the Form_Load event. The error happens at the .EDIT line. When I use intelesense .EDIT is not available, only .EDITMode is. I don't understand this since I have VB6 on both machines (work and home) they are both running Windows XP and use Microsoft Office 2003.
Private Sub Form_Load()
Today = Format(Now, "Short Date")
MakeConnection
Dim diff As Integer
'//Update the pets ages
Set rs = db.OpenRecordset("select * from pets")
With rs
Do While Not rs.EOF
diff = DateDiff("d", !AgeDate, Today)
If DateDiff("d", Today, !AgeDate) >= 365 Then
.Edit
!Age = !Age + 1
!AgeDate = Today
.Update
.MoveNext
Else
.MoveNext
End If
Loop
End With
rs.Close
db.Close
FillColorCombo
FillType
End Sub