SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsDatabaseSQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old March 31st, 2004, 02:40 PM
benacker benacker is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Location: Vancouver
Posts: 11 benacker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 37 m
Reputation Power: 0
Unhappy In need of an INSERT

I can't the following INSERT statement to work...

Dim oConn, rs, strSql, filePath
filePath = Server.MapPath("cust_users.mdb")

Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & filePath

strSql = "INSERT INTO users (username, password, fldFName, fldLName) VALUES ('"&txtUsername&"','"&txtPassword&"','"&txtFName&"','"&txtLName&"')"

set rs = oConn.Execute(strSql)
oConn.close
set rs = nothing
set oConn = nothing

any help would be greatly appreciated...

Reply With Quote
  #2  
Old March 31st, 2004, 03:53 PM
Memnoch's Avatar
Memnoch Memnoch is offline
Unholy Moderator
Click here for more information.
 
Join Date: Oct 2003
Location: In hell, where did you think?
Posts: 11,781 Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 8 h 45 m 55 sec
Reputation Power: 470
are you getting any errors?
Try this
Code:
Dim oConn, rs, strSql, filePath 
filePath = Server.MapPath("cust_users.mdb")

Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & filePath 

strSql = "INSERT INTO users (username, password, fldFName, fldLName) VALUES ('" & txtUsername & "','" & txtPassword & "','" & txtFName & "','" & txtLName & "')"

oConn.Execute(strSql)
oConn.close
set oConn = nothing

Reply With Quote
  #3  
Old March 31st, 2004, 04:07 PM
benacker benacker is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Location: Vancouver
Posts: 11 benacker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 37 m
Reputation Power: 0
I get an internal server error with both...Am I missing something?

ps, thanks for the quick reply!

Reply With Quote
  #4  
Old March 31st, 2004, 04:36 PM
Memnoch's Avatar
Memnoch Memnoch is offline
Unholy Moderator
Click here for more information.
 
Join Date: Oct 2003
Location: In hell, where did you think?
Posts: 11,781 Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level)Memnoch User rank is Lieutenant Colonel (40000 - 50000 Reputation Level) 
Time spent in forums: 3 Weeks 5 Days 8 h 45 m 55 sec
Reputation Power: 470
In internet explorer turn off "Show Friendly HTTP Errors"
Tools>Internet Options>Advanced Tab>Under Browsing Uncheck the "Show Friendly HTTP Errors" check box.

Then post the error message you receive.

Reply With Quote
  #5  
Old March 31st, 2004, 04:47 PM
benacker benacker is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Location: Vancouver
Posts: 11 benacker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 37 m
Reputation Power: 0
Its a 500 error,

HTTP 500 - Internal server error
Internet Explorer




Reply With Quote
  #6  
Old March 31st, 2004, 04:49 PM
benacker benacker is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Location: Vancouver
Posts: 11 benacker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 37 m
Reputation Power: 0
sorry, I hadn't done the first part yet....



Microsoft JET Database Engineerror '80040e14'

Syntax error in INSERT INTO statement. /customers/do_add_customer.asp, line 32

Reply With Quote
  #7  
Old March 31st, 2004, 04:57 PM
benacker benacker is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Location: Vancouver
Posts: 11 benacker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 37 m
Reputation Power: 0
I FOUND IT!!! password is a reserved word so I needed delimiters.

Thank you for your help! Taking off the friendly errors has helped out a bunch
!m!

Reply With Quote
Reply

Viewing: ASP Free ForumsDatabaseSQL Development > In need of an INSERT


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT