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

CAN ANYONE HELP???

Status
Not open for further replies.

slickent1

Technical User
May 12, 2004
3
US
Can Someone Help
This is my code:

<%
Dim objConn
Dim objRS
%>

<%
Set objConn = Server.CreateObject("ADODB.Connection")
objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source =" & Server.MapPath ("/Kim/database/reservation.mdb") & ";Mode=ReadWrite;" objConn.Open
%>

<%
Set objRS = Server.CreateObject("ADOBD.RecordSet")
objRS.Open "reservationtable", odjConn, , 3 , 2
objRS.moveFirst
%>
<%
dbName = ucase (trim(strUserName))
dbDayOfReservation = ucase (trim(strDayOfReservation))
dbTimeOfReservation = ucase (trim(strTimeOfReservation))
dbNumberOfGuests = ucase (trim(strNumberOfGuests))
dbEntree = ucase (trim(strEntree))
dbUserTelephoneNumber = ucase (trim(strUserTelephoneNumber))

objRS.AddNew
objRS ("Name") = dbName
objRS ("DayOfReservation") = dbDayOfReservation
objRS ("TimeOfReservation") = dbTimeOfReservation
objRS ("NumberOfGuests") = dbNumberOfGuests
objRS ("Entree") = dbEntree
dbjRS ("UserTelephoneNumber") = dbUserTelephoneNumber

response.write "Your data has been stored"
objRS.update
objRS.Close
Set objRS = Nothing
objConn.Close
Set objConn = Nothing
response.end
%>



and i am getting this error message:

Microsoft VBScript compilation error '800a0401'

Expected end of statement

/macromedia/dreamweaver/Kim/confor2.asp, line 27

objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source =" & Server.MapPath ("/Kim/database/reservation.mdb") & ";Mode=ReadWrite;" objConn.Open

How can i fix this...
Can someone please help

 
Hello slickent1,

Are you copying from some model base code?! Watch lines wrap and/or delimiter.
[1] objConn.Open should be on a new line.
objConn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source =" & Server.MapPath ("/Kim/database/reservation.mdb") & ";Mode=ReadWrite;"
objConn.Open
[2] Another typos, it seems.
Set objRS = Server.CreateObject("ADODB.RecordSet")

regards - tsuji
 
tsuji,
Yes, its is on a model. I am learning vbscripting in school.

Let me see if that works.

thank you very much in advance
 
In order to the objConn.Open on a new line. How exactly would i do that?

 
Slickent1,

Base on model script is all right. I do it all the time. What I meant is when copy and paste, watch out line wraps, new lines and sometimes underscores misarranged.

On a new line is exact what I've shown you up there. Each line of code is followed by a carriage return. Multiple instruction on the same line should be separated by colon ":".

- tsuji
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top