Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQLBase ODBC and .NET Insert statement problem.

Status
Not open for further replies.

dranath

Programmer
Mar 13, 2007
2
GB
Hi All,

I get the following error:

ERROR [HY000] [Gupta][ODBC Driver][SQLBase]00915 PRS IVC Invalid constant

Has anyone any idea of how to get round the problem?
The insert command is only 2 fields!!
InsertCommand="INSERT INTO T_WEB(SURNAME,FORENAME) VALUES (@SURNAME,@FORENAME)"
<InsertParameters>
<asp:FormParameter Name="SURNAME" Type="String" FormField="surnameTextBox.Text" DefaultValue="name" />
<asp:FormParameter Name="FORENAME" Type="String" FormField="firstNameTextBox.Text" DefaultValue="name" />
</InsertParameters>

Thanks! Dran
 
A potential problem with the sql is you are renerating

insert into a(b,c) values (henry,john)
where as you want the statment to read
insert into a(a,b) values('henry',john')

so may be your statement would be

cmd= "insert into a (a,b) values ('x1','x2')".replace("x1",surname).replace("x2",forename)

you could use your current format but you will have to handle the single qoutes yourself.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top