If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > I Get An Error When Inserting Data in Access

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-24-07, 07:39
email4junaid email4junaid is offline
Registered User
 
Join Date: Oct 2007
Posts: 1
I Get An Error When Inserting Data in Access

Dear Brother



When i submit the data to database i get an internal server error . i am write the following code in my submit.asp file for entering data in database . if u please check this code and remove any error i am very thankful to all of u.





<%
dim exhibition , cname ,caddress , ccity , ccountry , cperson , cdesignation , ctelephone , ccellphone , cemail , cfax , cweb , cproduct ,carea ,data_conn,query_sql,rec_exe



' getting values from previous form page



exhibition = Request.form("exhibition")

cname = Request.form("cname")

caddress = Request.form("caddress")

ccity = Request.form("ccity")

ccountry = Request.form("ccountry")

cperson = Request.form("cperson")



cdesignation = Request.form("cdesignation")

ctelephone = Request.form("ctelephone")

cmobile = Request.form("cmobile")

cemail = Request.form("cemail")

cfax = Request.form("cfax")

cweb = Request.form("cweb")

cproduct = Request.form("cproduct")

carea = Request.form("carea")



'Creating Data Connection



Set data_conn=Server.CreateObject("ADODB.Connection")

data_conn.ConnectionString ="DSN=booking"

data_conn.Open



'Create Data Entry command



query_sql="INSERT INTO booking(Exhibition,CompanyName,Address,City,Countr y,ContactPerson,Designation,Telephone,Cell,Email,F ax,Web,Product,Area)



VALUES('"&request.form("exhibition")&"' , '"&request.form("cname")& "' , '"&request.form("caddress")&"' , '"&request.form("ccity")&"' , '"&request.form("ccountry")&"' , '"&request.form("cperson")&"' , '"&request.form("cdesignation")&"' , "&request.form("ctelephone")&" , "&request.form("cmobile")&" , '"&request.form("cemail")&"' , "&request.form("cfax")&",'"&request.form("cweb")&" ','"&request.form("cproduct")&"','"&request.form(" carea")&"')"

Set rec_exe=data_conn.execute(query_sql)
%>
Reply With Quote
  #2 (permalink)  
Old 10-24-07, 08:20
gvee gvee is offline
www.gvee.co.uk
 
Join Date: Jan 2007
Location: UK
Posts: 10,156
Something really confuses me here...
You go to all that trouble of defining variables and assigning values to them, but you don't use them!!

Anyhow, I think your problem is the connection string. Check out connectionstrings.com for more information on what it should look like.
__________________
George
Twitter | Blog
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

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