|
-
Sep 11th, 2001, 10:17 PM
#1
Thread Starter
Addicted Member
Msflexgrid Saving to database problem
I've got a problem with my msflexgrid1 while attempting to save the data
to the database.
I get an datatype conversion error...but I can't figure out why. I aslo dont
understand the big numbers that I get while looking at the msflexgrid1.text
value.
HElp!!!!!!!!!!!
Please offer some thoughts!!
If I leave my cursor/mouse on that erorr line I get the value for msflexgrid1.text
which is a hudge number: 11753595471532175421000000000000000000000000000000000000 . . . .
VB Code:
Private Sub Command4_Click()
'save button CODE IS BELOW ?> > >
'declare local variables . .
Dim r As Integer
Dim t As Long
myrs.MoveFirst
For r = 1 To MSFlexGrid1.Rows - 1 ' cycle thru the rows
myrs.Edit ' this opens the recordset record to be opend to be edited
MSFlexGrid1.Row = r
For t = 0 To myrs.Fields.Count 'cycle thru the fields/columns
MSFlexGrid1.Col = t
myrs.Fields(t) = Format$(Val(MSFlexGrid1.Text)) [COLOR=royalblue]Error Here::3421 Data Type Conversion Error[/COLOR]
Next t
myrs.Update
myrs.MoveNext
Next r
end Sub
-
Sep 12th, 2001, 01:45 AM
#2
New Member
What are the datatypes of the fields/columns in the database table where you are saving the data?
-
Sep 13th, 2001, 09:42 PM
#3
Thread Starter
Addicted Member
SAVE PROBLEM TO DATABASE USING FLEXGRID
Ok, still stuck.
I tried removing those val and format, and now I get an error that says
the field is unupdateable.
Field cant be updated. Erorr 3164.
What does that error mean & how can it be fixed >?
Thanks for the help.
VB Code:
visual basic code:
Private Sub Command4_Click()
'save button CODE IS BELOW ?> > >
'declare local variables . .
Dim r As Integer
Dim t As Long
myrs.MoveFirst
For r = 1 To MSFlexGrid1.Rows - 1 ' cycle thru the rows
myrs.Edit ' this opens the recordset record to be opend to be edited
MSFlexGrid1.Row = r
For t = 0 To myrs.Fields.Count 'cycle thru the fields/columns
MSFlexGrid1.Col = t
myrs.Fields(t) = Format$(MSFlexGrid1.Text) -->> ERROR IS HERE!@
Next t
myrs.Update
myrs.MoveNext
Next r
End Sub
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
|