-
Apr 29th, 2012, 05:51 PM
#1
Thread Starter
Junior Member
Error : Not a legal OleAut date.
I get this error when i try to drag a record from a file;
Code:
Private Sub cboBookingID_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cboBookingID.Click
Me.cboBookingID.Items.Clear()
'output all records method 1
NumberOfRecords = LOF(4) / Len(OneBooking)
For Index = 1 To NumberOfRecords
FileGet(4, OneBooking, Index)
If OneBooking.Deleted = False Then
Me.cboBookingID.Items.Add(Index)
End If
Next Index
End Sub
The bit in bold is where the error crashes at. Any idea why it crashes, it because i used this code for like 5 other files and worked perfectly fine.
-
Apr 29th, 2012, 05:58 PM
#2
Re: Error : Not a legal OleAut date.
Originally Posted by Barhuumi
I get this error when i try to drag a record from a file;
Code:
Private Sub cboBookingID_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cboBookingID.Click
Me.cboBookingID.Items.Clear()
'output all records method 1
NumberOfRecords = LOF(4) / Len(OneBooking)
For Index = 1 To NumberOfRecords
FileGet(4, OneBooking, Index)
If OneBooking.Deleted = False Then
Me.cboBookingID.Items.Add(Index)
End If
Next Index
End Sub
The bit in bold is where the error crashes at. Any idea why it crashes, it because i used this code for like 5 other files and worked perfectly fine.
As with your other post, consider better explaining the problem and code. Seeing you are using obsolete methods and more likely than not have Option Strict Off all the more important you provide more details.
-
Apr 29th, 2012, 06:30 PM
#3
Thread Starter
Junior Member
Re: Error : Not a legal OleAut date.
Originally Posted by kevininstructor
As with your other post, consider better explaining the problem and code. Seeing you are using obsolete methods and more likely than not have Option Strict Off all the more important you provide more details.
Sorry, i thought it was pretty self explanatory, and didn't explain the code since i used it over 10 times in this project. I was asking what the error was or what it meant since i have never come across it before.. but sure i'll break down the code for you.
Code:
Me.cboBookingID.Items.Clear() 'Clears combo box.
'output all records method 1
NumberOfRecords = LOF(4) / Len(OneBooking)
For Index = 1 To NumberOfRecords ' Loops thorough all records in file.
FileGet(4, OneBooking, Index) 'gets record one by one.
If OneBooking.Deleted = False Then 'Only finds records that isn't deleted.
Me.cboBookingID.Items.Add(Index) 'Then adds the record to the combo box.
End If
Next Index
Now that worked for me a coupla times, but what i don't get is why it crashes all of a sudden, and what the error means.
-
Apr 29th, 2012, 07:21 PM
#4
Re: Error : Not a legal OleAut date.
Okay next question, I am not a VB6 programmer I have never used FileGet. So what does the file content look like, is it a structured text file or binary?
-
Apr 29th, 2012, 08:14 PM
#5
Re: Error : Not a legal OleAut date.
Originally Posted by kevininstructor
Okay next question, I am not a VB6 programmer I have never used FileGet. So what does the file content look like, is it a structured text file or binary?
It looks like he is attempting to enumerate several records in a binary file. Each record would be of type OneBooking. This was a pretty common way to store data in VB6 and Ad-hoc databases were made and read in this way in QuickBasic.
The members would be layout in much the same manner as a sequential structure in memory with padding and alignment and so on.
-
Feb 25th, 2019, 09:59 PM
#6
New Member
Re: Error : Not a legal OleAut date.
can I see OneBooking structure
-
Feb 26th, 2019, 11:45 AM
#7
Addicted Member
Re: Error : Not a legal OleAut date.
The error suggest that a date field in the OneBooking structure, is not compatible with the data being read in.
-
Feb 27th, 2019, 12:26 AM
#8
Re: Error : Not a legal OleAut date.
Originally Posted by bmwpete
The error suggest that a date field in the OneBooking structure, is not compatible with the data being read in.
This thread was made all the way back in 2012, 7 years ago.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|