need your help!
-
hi, I'm practicing how to use sql language in vb 6.0 via ADODC. I'm getting problem with adding a data in INSERT INTO statement. Because my code in the command buttons is just... Adodc1.RecordSource = "INSERT INTO tblname(firstname, lastname) VALUES('" & txtfname.Text & "','" & txtlname.Text & "')" but the data in the textbox are not saved in the data base... can you help me please.
-
hi, I'm practicing how to use sql language in vb 6.0 via ADODC. I'm getting problem with adding a data in INSERT INTO statement. Because my code in the command buttons is just... Adodc1.RecordSource = "INSERT INTO tblname(firstname, lastname) VALUES('" & txtfname.Text & "','" & txtlname.Text & "')" but the data in the textbox are not saved in the data base... can you help me please.
Did you try with Connection object
myConn.Execute "INSERT INTO tblname(firstname, lastname) VALUES('" & txtfname.Text & "','" & txtlname.Text & "')"
OR also you can it with Command object OR Try your way
Adodc1.RecordSource = "INSERT INTO tblname(firstname, lastname) VALUES('" & txtfname.Text & "','" & txtlname.Text & "')"
Adodc1.RefreshParwej Ahamad R & D with IIS 5.0/6.0
-
Did you try with Connection object
myConn.Execute "INSERT INTO tblname(firstname, lastname) VALUES('" & txtfname.Text & "','" & txtlname.Text & "')"
OR also you can it with Command object OR Try your way
Adodc1.RecordSource = "INSERT INTO tblname(firstname, lastname) VALUES('" & txtfname.Text & "','" & txtlname.Text & "')"
Adodc1.RefreshParwej Ahamad R & D with IIS 5.0/6.0
i've tried the
Adodc1.RecordSource = "INSERT INTO tblname(firstname, lastname) VALUES('" & txtfname.Text & "','" & txtlname.Text & "')"
Adodc1.Refreshbut there was an error saying "Operation is not allowed when the object is closed" . what should i do?
-
i've tried the
Adodc1.RecordSource = "INSERT INTO tblname(firstname, lastname) VALUES('" & txtfname.Text & "','" & txtlname.Text & "')"
Adodc1.Refreshbut there was an error saying "Operation is not allowed when the object is closed" . what should i do?
Do you have an open connection to the database? Doesn't sound like it from that error message.
--------------------------- Blogging about SQL, Technology and many other things
-
i've tried the
Adodc1.RecordSource = "INSERT INTO tblname(firstname, lastname) VALUES('" & txtfname.Text & "','" & txtlname.Text & "')"
Adodc1.Refreshbut there was an error saying "Operation is not allowed when the object is closed" . what should i do?
(1) Before going to execute any query first check your database connection is open or close. (2) Did you try with connection object :
myConn.Execute "INSERT INTO tblname(firstname, lastname) VALUES('" & txtfname.Text & "','" & txtlname.Text & "')"
Parwej Ahamad R & D with IIS 5.0/6.0
-
(1) Before going to execute any query first check your database connection is open or close. (2) Did you try with connection object :
myConn.Execute "INSERT INTO tblname(firstname, lastname) VALUES('" & txtfname.Text & "','" & txtlname.Text & "')"
Parwej Ahamad R & D with IIS 5.0/6.0
-
yup, I've tried it and it worked but I've also change my data base connection using stored procedure. Thanks for the help. :)
I am not getting this point : "but I've also change my data base connection using stored procedure" ?
Parwej Ahamad R & D with IIS 5.0/6.0
-
I am not getting this point : "but I've also change my data base connection using stored procedure" ?
Parwej Ahamad R & D with IIS 5.0/6.0
Instead of using the ADODC. I've changed the connection to this
Private nameConn As ADODB.Connection
Private nameCMD As ADODB.Command
Private nameRST As ADODB.RecordsetPrivate Sub ConnectTODB()
Set nameConn = New ADODB.ConnectionnameConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\meki\meki training\dbnames.mdb"
nameConn.OpenSet nameCMD = New ADODB.Command
Set nameCMD.ActiveConnection = nameConn
End Subso that the nameComm.Execute command will work.
-
Do you have an open connection to the database? Doesn't sound like it from that error message.
--------------------------- Blogging about SQL, Technology and many other things
-
Instead of using the ADODC. I've changed the connection to this
Private nameConn As ADODB.Connection
Private nameCMD As ADODB.Command
Private nameRST As ADODB.RecordsetPrivate Sub ConnectTODB()
Set nameConn = New ADODB.ConnectionnameConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=E:\meki\meki training\dbnames.mdb"
nameConn.OpenSet nameCMD = New ADODB.Command
Set nameCMD.ActiveConnection = nameConn
End Subso that the nameComm.Execute command will work.
Oh! Good :)
Parwej Ahamad R & D with IIS 5.0/6.0