' I HAVE CHANGED THE CODE TO THIS: BUT I AM GETTING THIS ERROR BELOW. I HAVE NUMBER THEM LINE 1,2,3
'1. Run-time error'40002'
'2. s1000: [MySQL][ODBC 3.51 Driver][mysqld-5.5.24]Incorect
'3. value: 'Text2' for age at row 1
Option Explicit
Dim cnMySql As New rdoConnection
Dim rdoQry As New rdoQuery
Dim rdoRS As rdoResultset
Private Sub Form_Load()
cnMySql.CursorDriver = rdUseOdbc
cnMySql.Connect = "uid=root;pwd=moses12;server=localhost;driver={MySQL ODBC 3.51 Driver};database=SRMS;dsn=SRMS;"
End Sub
Private Sub cmdSave_Click()
cnMySql.EstablishConnection
With rdoQry
.Name = "root"
.SQL = "insert into regstudent (n_Student,age,sex,nationality,p_birth,d_birth,religion,f_name,tel,occupation,w_place,F_address,m_name,tel2,occupation2,w_place2,F2_address,prev_school,Location,grade_attained,aggregates,code) values ('Text1','Text2','Text3','Text4','Text5','Text6','Text7','Text8','Text9','Text10','Text11','Text12','Text13','Text14','Text15','Text16','Text17','Text18','Text19','Text20','Text21','Text22')"
'.SQL = "Insert into regstudent (admin,tester,user2,user3,user4) VALUES ('101','202','303','404','505')"
Set .ActiveConnection = cnMySql
'THIS LINE IS HIGHLIGHTED YELOW WHENEVER I RUN MY CODE
Set rdoRS = .OpenResultset(rdOpenKeyset, rdConcurRowVer)
End With
rdoRS.Close
cnMySql.Close
'End If
End Sub
1 Replies - 300 Views - Last Post: 17 August 2012 - 02:09 AM
#1
THE ERROR I AM GETTING IS " Run-time error'40002' "
Posted 17 August 2012 - 02:03 AM
Replies To: THE ERROR I AM GETTING IS " Run-time error'40002' "
#2
Re: THE ERROR I AM GETTING IS " Run-time error'40002' "
Posted 17 August 2012 - 02:09 AM
You already have a post on this, if someone can answer it they will do.
Please don't open duplicate posts because nobody has replied.
If you have something new to add, then add it to your original post.
Please don't open duplicate posts because nobody has replied.
If you have something new to add, then add it to your original post.
Page 1 of 1
|
|

New Topic/Question
This topic is locked



MultiQuote




|