Sunday, February 12, 2012

Cant INSERT into databases table !

Hi everyone !!!
The past two days I am trying to make a survey to work !
Unfortunately I haven't accomplised yet :-(

So this is my problem...
I am using ASP, MS-SQL for the survey.
When I take the survey for the first time evetything is working and the fields are inserted correctly in the table !
If I take the survey for the second time... there is no insert in the table !!!

This is code...

dim Rs_Qu
set Rs_Qu = myCon.Execute("Select * From QUESTION ")
if Rs_Qu.Eof then
myCon.Execute ("Insert into QUESTION (" & SqlStr_1 & ") values (" & SqlStr_2 & ")")

Also, I must tell you that when I use the SQL Pane and do ...

Insert into QUESTION (" & SqlStr_1 & ") values (" & SqlStr_2 & ")
replacing of course " & SqlStr_1 & " and " & SqlStr_2 & "
i can insert the entry !!!

Please help !OK, I'm no VB expert, but after you insert a record isn't the EOF no longer satisfied upon opening the recordset? Shouldn't you have a command to move to the end of the recordset?|||Thanks mate !
It worked !!!
:beer:

No comments:

Post a Comment