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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

conn.CreateDynaSet

Status
Not open for further replies.

codehead

Programmer
Aug 25, 1999
96
US
Hello All:

Can I use a conn.CreateDynaSet to do an INSERT into an Oracle database, or should I be using a different type of connection?

Thanks!

 
dint quite understand your question. COuld you please elaborate a bit...

-DNG
 
Hi DNG,

I'm using conn.CreateDynaSet to get my result set from my Oracle database. When I use it to try to do an INSERT into my database, I get a "comment missing" error, which makes no sense (could be a syntax/typo though). If I use a conn.execute to do the INSERT, I get a "Object doesn't support this property or method" error message.

Thanks.

 
No, that just gives me an "80" error message in my Web log.

Just to clarify, in my message above, I should have said the error message said "comma missing" not "comment missing".

Also, I'm using CreateObject("OracleInProcServer.XOraSession") to connect to my Oracle database.

Thanks.

 
Actually, with conn.CreateDynaSet you have to use "Cint(0)" for some reason. Here is a simplified version of my code:

set insStmt = conn.CreateDynaSet("INSERT INTO TBL_REQUIREMENTS (POINT_OF_CONTACT, FAX) VALUES ('"&request("POC")&"','"&request("FAX")&"'",Cint(0))

This produces the Web log error message of:

"ORA-00917:_missing_comma"

Thanks.

 
may be there are some apostrophe's in the request variables...

try using replace() function to replace single quote with double quotes...

try this:

set insStmt = conn.CreateDynaSet("INSERT INTO TBL_REQUIREMENTS (POINT_OF_CONTACT, FAX) VALUES ('"&Replace(request("POC"),"'","''")&"','"&replace(request("FAX"),"'","''")&"'",Cint(0))

-DNG
 
also i would suggest you to hardcode some values and test your sql statement...response.write is also not a bad idea...

-DNG
 
I finally figured it out. It was just a syntax error. And your conn.ExecuteSQL does work (but no "set" statement is needed nor is the "Cint(0)").

Thanks again, DNG!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top