hey all!
i try to fill the form from mysql database. I connect to DB successfuly.
my form has a lot of text and combo boxes. i named all the same as table fields so i could use this kind of trick to fill them
here is my problem.... it fills some data successfuly (Date, Name, Age, ... ) but then when it tries to fill data with type set to TEXT (Description) i get error:
Cast from type DBNull to type String is not valid.
funny thing is that this field (Description) in database contains data.... it is not empty or null
please help if you can!
thanx in advance
p.s. please dont attack me cos im still using COM....
Matej
i try to fill the form from mysql database. I connect to DB successfuly.
my form has a lot of text and combo boxes. i named all the same as table fields so i could use this kind of trick to fill them
Code:
For i = 0 To rs.Fields.Count - 1
With rs
For Each ctrl In Controls
If TypeOf ctrl Is TextBox Then
If ctrl.Name = .Fields(i).Name Then
If Not .Fields(.Fields(i).Name).Value Is DBNull.Value Then
ctrl.Text = .Fields(.Fields(i).Name).Value
End If
End If
End If
Next
End With
Next
here is my problem.... it fills some data successfuly (Date, Name, Age, ... ) but then when it tries to fill data with type set to TEXT (Description) i get error:
Cast from type DBNull to type String is not valid.
funny thing is that this field (Description) in database contains data.... it is not empty or null
please help if you can!
thanx in advance
p.s. please dont attack me cos im still using COM....
Matej