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

INSERT INTO problem

Status
Not open for further replies.

LinuxKommy

Technical User
Apr 2, 2002
31
0
0
US
hi,

i'm having a problem with this code

objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.Mappath("loginlog.mdb") & "; Jet OLEDB:Database Password="

sqlString = "INSERT INTO Distributor (Company, Date) VALUES ( '" & login & "', #" & Date & "# )"

objConn.Execute sqlString

when i remove the 'date' parts, the query works, so i know it has to do with that section, but when it's there i get a HTTP 500.100 error....how is the date supposed to be formatted here?

thanks,
lk
 
not sure what this line is for
& "; Jet OLEDB:Database Password="


uncheck show friendly HTTP errors in IE
tools-->internet options-->advanced

this will give you a valid workable error
also try Now() instead of Date. and if Date is a predefined variable use conventional naming tech's. naming something that is such a restricted word is bad form

_____________________________________________________________________
Please help! I'm falling asleep over here!
onpnt2.gif

 
thanks...you're right...access doesn't like having a field called "Date"

i thought that the

Database Password="

part was for a password...i haven't protected it yet...it's still in development

thanks again!
lk
 
onpnt, that's a new one on the able-consulting connection string site. I had to do a double-take too.

If using a Workgroup (System Database)

oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:\somepath\mydb.mdb;" & _
"Jet OLEDB:System Database=MySystem.mdw", _
"myUsername", "myPassword"
Note, remember to convert both the MDB and the MDW to the 4.0
database format when using the 4.0 OLE DB Provider.


If MDB has a database password

oConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=c:\somepath\mydb.mdb;" & _
"Jet OLEDB:Database Password=MyDbPassword", _
"myUsername", "myPassword"
 
I guess I'm just getting old and slower down on my updates. [lol]

_____________________________________________________________________
Please help! I'm falling asleep over here!
onpnt2.gif

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top