Current location: Hot Scripts Forums » Programming Languages » ASP » insert statement


insert statement

Reply
  #1 (permalink)  
Old 08-11-03, 09:38 PM
sasi sasi is offline
Newbie Coder
 
Join Date: Aug 2003
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
insert statement

..i tried to insert data's to a table and its working ..but the only problem is when i click the button Submit(to add data)its adding 2 rows of data...1 is the data's which i entered n the other 1 is a blank row of data...so when i log out n run the form again..error occured..saying that confilcts in a primary key..coz there is a blank rows in the table...


the code is like this

<%

dim connstring,strsql
dim strname,stremail
strname=request.form("frmname")
stremail=request.form("frmemail")
connstring="Provider=SQLOLEDB;User ID="name";Password="password"

set my_conn=server.createobject("ADODB>Connection")
my_conn.Open connstring
strsql="INSERT INTO UserEmails(Name,email)values("&"'"&strName&'",'"&s tremail&"')"
set rs=my_conn.execute(strsql)
%>
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
If then statement acting up! geneane ASP 1 09-30-03 04:32 PM
insert into SQL database Dahquim ASP 1 07-27-03 07:34 PM
More Difficult Select Statement for Newbie bytwo ASP 2 07-01-03 04:46 AM
Avatar? I can't insert one... PeTAR Hot Scripts Forum Questions, Suggestions and Feedback 6 06-14-03 02:48 AM


All times are GMT -5. The time now is 03:11 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.