Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

ASP.NET Forum


You are currently viewing our ASP.NET Forum as a guest. Please register to participate.
Login



Reply
error when i do query insert to my data base
Old 05-28-2008, 09:32 AM error when i do query insert to my data base
Junior Talker

Posts: 1
Name: naama
Trades: 0
hi
i am trying to connecting to my database on Microsoft access, i do a insert query and i recive an error this is my syntak:
Quote:
<%

Dim conn, SQLstr
set conn= server.CreateObject("ADODB.connection")
conn.ConnectionString="Provider=Microsoft.Jet.OLED B.4.0;" & "Data Source=" & Server.MaPpath("/")& "../login.mdb;"
conn.open
SQLstr="INSERT INTO tblCreateUse(f_name)"
SQLstr= SQLstr & " VALUES (SQLstr= SQLstr & Request("f_name") & "') "
conn.Execute SQLstr
conn.Close

%>
and the message i recive is here:
Quote:
Error Type:
Microsoft JET Database Engine (0x80040E14)
INSERT INTO. he clame the mistake in this line
/regsup1.asp, line 6
please help me it in an emergency
i am at work, and i neet to solve this problem
thanks
nash31
nash31 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-28-2008, 10:52 AM Re: error when i do query insert to my data base
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
and the completed query looks like ??
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 06-08-2008, 01:52 PM Re: error when i do query insert to my data base
RabidSniper's Avatar
Skilled Talker

Posts: 57
Name: Jesse
Location: Phoenix, AZ
Trades: 0
Looks like a whacky string concat issue..

Since you are GOING to use string concat like that.. try it like..

SQLstr="INSERT INTO tblCreateUse (f_name)"
SQLstr= SQLstr & " VALUES ('" & Request("f_name") & "')"


Notice the single quotes on EITHER side of the string break doublequote..

Only problem is, this is bad form... try using Bind variables and SQL parameters instead.. It makes for a bit more code, but helps in protecting against SQL injection attacks.
RabidSniper is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to error when i do query insert to my data base
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.15623 seconds with 12 queries