McKirahan
Fri Oct 08 12:12:40 CDT 2004
This is a multi-part message in MIME format.
------=_NextPart_000_0039_01C4AD30.13984C00
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
"BBB" <bb@takas.lt> wrote in message =
news:#xVgmUUrEHA.3428@TK2MSFTNGP11.phx.gbl...
I don't know is it a good way. but this code is in html file named =
test.html
<script language=3DVBScript runat=3D"server">=20
set conn=3DCreateObject("ADODB.Connection")
conn.Provider=3D"Microsoft.Jet.OLEDB.4.0"
conn.Open "
http://www.mysite.lt/folder1/testa.mdb"
'testa.mdb is a file which was created at my computer using the code =
You have provided early:
dbFile=3D"testa.mdb"
set cat =3D CreateObject("ADOX.Catalog")
connStr =3D "Provider=3DMicrosoft.Jet.OLEDB.4.0;Data Source=3D" & =
dbFile
cat.Create connStr
So, after creation of "testa.mdb", i have copied "testa.mdb" to my ftp =
server, and the file is available at exactly =
"
http://www.mysite.lt/folder1/testa.mdb"=20
But when I execute the script above on the remote server, =
(...conn.Open
http://www.mysite.lt/folder1/testa.mdb...), I get error =
not a valid file name" ?? But the file exists!!!
What's the problem?.
</script>
1) Post in plain text.
2) you can't reference the database via a URL.
a) Use either Server.MapPath() ot the full physical path:
Server.MapPath(testa.mdb)
c:\inetpub\wwwroot\folder\testa.mdb
b) Use a DSN-less connection:
Const cDSN =3D "Provider=3DMicrosoft.Jet.OLEDB.4.0;Data =
Source=3D"
conn.Open cDSN & Server.MapPath(testa.mdb)
3) Read to other responses as I may have left something out.
------=_NextPart_000_0039_01C4AD30.13984C00
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4937.800" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<BLOCKQUOTE dir=3Dltr=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"BBB" <<A href=3D"mailto:bb@takas.lt">bb@takas.lt</A>> =
wrote in=20
message <A=20
=
href=3D"news:#xVgmUUrEHA.3428@TK2MSFTNGP11.phx.gbl">news:#xVgmUUrEHA.3428=
@TK2MSFTNGP11.phx.gbl</A>...</DIV>
<P><FONT face=3DArial size=3D2>I don't know is it a good way. but this =
code is in=20
html file named test.html</FONT></P>
<P><FONT face=3DArial size=3D2><script language=3DVBScript =
runat=3D"server">=20
<BR>set=20
=
conn=3DCreateObject("ADODB.Connection")<BR>conn.Provider=3D"Microsoft.Jet=
.OLEDB.4.0"<BR><BR>conn.Open=20
"
http://www.mysite.lt/folder1/testa.mdb"<BR>'testa.mdb is a file which =
was=20
created at my computer using the code You have provided =
early:</FONT></P>
<P><FONT face=3DArial size=3D2><FONT face=3D"Times New Roman"=20
size=3D3>dbFile=3D"testa.mdb"</FONT></FONT></P>
<P><FONT face=3DArial size=3D2><FONT face=3D"Times New Roman" =
size=3D3> set cat =3D=20
CreateObject("ADOX.Catalog")<BR> connStr =3D=20
"Provider=3DMicrosoft.Jet.OLEDB.4.0;Data Source=3D" &=20
dbFile<BR> cat.Create connStr</FONT><BR><BR>So, after creation of =
"<FONT=20
face=3D"Times New Roman" size=3D3>testa.mdb", i have copied =
"testa.mdb" to=20
my ftp server, and the file is available at <FONT =
face=3DArial=20
size=3D2>exactly=20
=
"
http://www.mysite.lt/folder1/testa.mdb"</FONT> </FONT></FONT></P>
<P><FONT face=3DArial size=3D2>But when<EM> I execute =
</EM>the script=20
above on the remote server, (...conn.Open <A=20
=
href=3D"
http://www.mysite.lt/folder1/testa.mdb">http://www.mysite.lt/fold=
er1/testa.mdb</A>...),=20
I get error not a valid file name" ?? But the =
file=20
exists!!!<BR>What's the problem?.</FONT></P>
<P><FONT face=3DArial size=3D2></script><BR></FONT></P>
<P><FONT face=3DArial size=3D2>1) Post in plain =
text.</FONT></P>
<P><FONT face=3DArial size=3D2>2) you can't =
reference the=20
database via a URL.</FONT></P>
<P><FONT face=3DArial size=3D2> a) =
Use either=20
Server.MapPath() ot the full physical path:</FONT></P>
<P><FONT face=3DArial size=3D2> =20
Server.MapPath(testa.mdb)</FONT></P>
<P><FONT face=3DArial size=3D2> =20
c:\inetpub\wwwroot\folder\testa.mdb</FONT></P>
<P><FONT face=3DArial><FONT size=3D2> =
b) Use a=20
DSN-less connection:</FONT></FONT></P>
<P><FONT face=3DArial size=3D2> =
Const cDSN =3D=20
"Provider=3DMicrosoft.Jet.OLEDB.4.0;Data Source=3D"</FONT></P>
<P><FONT face=3DArial><FONT size=3D2> =
</FONT><FONT=20
face=3DArial><FONT size=3D2> conn.Open cDSN &=20
Server.MapPath(</FONT><A href=3D"file://\\folder\testa.mdb"><FONT=20
size=3D2>testa.mdb</FONT></A><FONT size=3D2>)</FONT></FONT></FONT></P>
<P><FONT face=3DArial size=3D2>3) Read to other =
responses as I=20
may have left something out.</FONT></P></BLOCKQUOTE></BODY></HTML>
------=_NextPart_000_0039_01C4AD30.13984C00--