ASP error

ASP error

am 25.04.2006 06:50:13 von jagdishl

Hi
I got this VB script compilation error as shown below.I checked up a
web-site which

Microsoft VBScript compilation (0x800A0400)
Expected end of statement
/Informs/membership_form.asp, line 34, column 66

The line which has the error is also shown below.Please do


adocon.Open "Driver = {Microsoft Access Driver(*.mdb)}; DBQ=" &
C:\Documents and Settings\Jugluck\Desktop\('informs.mdb')

I would really appreciate if you could let me know the exact error in
this code.
Thanks

Jagdish.l

Re: ASP error

am 25.04.2006 09:22:07 von Mike Brind

jagdishl@gmail.com wrote:
> Hi
> I got this VB script compilation error as shown below.I checked up a
> web-site which
>
> Microsoft VBScript compilation (0x800A0400)
> Expected end of statement
> /Informs/membership_form.asp, line 34, column 66
>
> The line which has the error is also shown below.Please do
>
>
> adocon.Open "Driver = {Microsoft Access Driver(*.mdb)}; DBQ=" &
> C:\Documents and Settings\Jugluck\Desktop\('informs.mdb')
>
> I would really appreciate if you could let me know the exact error in
> this code.
> Thanks
>
> Jagdish.l

2 errors:

Error 1. You've terminated the connection string after DBQ=, and then
concatentated another string without putting it in quotes (your path).

Error 2. You've placed the name of the datafile in brackets, and put
single quotes around it. This is not a valid path syntax (unless you
really have those characters as part of the database file name).

I suggest you use the native OLEDB provider for Access. From a
performance point of view, it's considerably better than the ODBC
driver you are using. Then your connection string will look like this:

strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Documents
and Settings\Jugluck\Desktop\informs.mdb;"
Set adocon = Server.CreateObject("ADODB.Connection")
adocon.open strConn

You will obviously need to ensure that the IUSR_Machinename has modify
permissions for your desktop in order to access the database.

--
Mike Brind