Description:
I'm currently trying with a project in VB.net with MySQL. I use MySQL .net connector and ADODB to access mysql database. It's easier for me to connect and update fields through ADODB. Do u have any special functions to do so. please send me an copy of that.
And in my code at one point of time, "Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done." this error has been popued up. I'm attaching the cod here with.
Con = new ADODB.Connection(connectionString)
ProRss = New ADODB.Recordset
ProRss.Open("SELECT * FROM Emp_PD WHERE CompID='" & Comp_Id & "' && EmpID = '" & TxtEmpID.Text & "'", Con, CursorTypeEnum.adOpenDynamic, LockTypeEnum.adLockOptimistic)
If ProRss.EOF Then ProRss.AddNew() : ProRss.Fields("CreatedOn").Value = Format(Today, "yyyy/MM/dd")
ProRss.Fields("CompID").Value = Comp_Id
ProRss.Fields("EmpID").Value = TxtEmpID.Text
If Not TextBox4.Text = "" Then ProRss.Fields(6).Value = TextBox4.Text
ProRss.Fields("EmpDOB").Value = DateBirthPicker.Value
If Not ComboBox1.SelectedIndex = -1 Then ProRss.Fields("Sex").Value = CType(ComboBox1.SelectedItem, Char)
If Not TextBox5.Text = "" Then ProRss.Fields("Religion").Value = TextBox5.Text <- Here the error occurs ->
If Not TextBox12.Text = "" Then ProRss.Fields("EyeR").Value = TextBox12.Text
ProRss.Update()
ProRss.Close()
When it's null string then no problem, otherswise if i'm trying to store a string valuse then error generates.
Please help me in rectifing this error as soon as possible.
Thanking you!
Regards,
Vignesh
How to repeat:
Con = new ADODB.Connection(connectionString)
ProRss = New ADODB.Recordset
ProRss.Open("SELECT * FROM Emp_PD WHERE CompID='" & Comp_Id & "' && EmpID = '" & TxtEmpID.Text & "'", Con, CursorTypeEnum.adOpenDynamic, LockTypeEnum.adLockOptimistic)
If ProRss.EOF Then ProRss.AddNew() : ProRss.Fields("CreatedOn").Value = Format(Today, "yyyy/MM/dd")
ProRss.Fields("CompID").Value = Comp_Id
ProRss.Fields("EmpID").Value = TxtEmpID.Text
If Not TextBox4.Text = "" Then ProRss.Fields(6).Value = TextBox4.Text
ProRss.Fields("EmpDOB").Value = DateBirthPicker.Value
If Not ComboBox1.SelectedIndex = -1 Then ProRss.Fields("Sex").Value = CType(ComboBox1.SelectedItem, Char)
If Not TextBox5.Text = "" Then ProRss.Fields("Religion").Value = TextBox5.Text <- Here the error occurs ->
If Not TextBox12.Text = "" Then ProRss.Fields("EyeR").Value = TextBox12.Text
ProRss.Update()
ProRss.Close()