Hi.
Sorry for the maybe silly question.
I am a newbe in vbscript. I have programmed with VB, VB .NET, PHP,
JavaScript, but never with databases.
Now I must to do some project where a database would be usefull.
But the hosting plan which is chossed by my company
doesn't include MySQL databases:(, so I cann't to use e.g. php for this
purpose.
So, the question is:
Can I myself (without contacting the hosting provider) create and use a
simple file on server, like "my.mdb", like a database, using vbscript?
If so, can You suggest a good site in order to get the beginning info?

Thanks for any info.

Re: create database with vbscript ? by BBB

BBB
Fri Oct 08 06:35:26 CDT 2004

Thanks for reply.
But what if I what to create "test.mdb" on server?
I recieve "ActiveX component can't create object" error.
Could ADO work on Unix server?
What is the alternative for Microsoft technology?



"Viatcheslav V. Vassiliev" <msnewsgroup@www-sharp.com> wrote in message
news:u4XbzKSrEHA.516@TK2MSFTNGP09.phx.gbl...
> You could create Access database like this:
>
> dim dbFile
> dbFile = "c:\temp\test.mdb"
>
> dim connStr
> dim cat
> set cat = CreateObject("ADOX.Catalog")
> connStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dbFile
> cat.Create connStr
> set cat = nothing
>
> 'Now use ADO to use this database
>
> You may find many examples in ADO documentation, look for ado*.chm on your
> hard drive or use MSDN (http://msdn.microsoft.com)
>
> //------------------------------------
> Regards,
> Vassiliev V. V.
> http://www-sharp.com -
> Scripting/HTA/.Net Framework IDE
>
> "BBB" <bb@takas.lt> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ:
> news:%231rYtoRrEHA.1204@TK2MSFTNGP12.phx.gbl...
>> Hi.
>> Sorry for the maybe silly question.
>> I am a newbe in vbscript. I have programmed with VB, VB .NET, PHP,
>> JavaScript, but never with databases.
>> Now I must to do some project where a database would be usefull.
>> But the hosting plan which is chossed by my company
>> doesn't include MySQL databases:(, so I cann't to use e.g. php for this
>> purpose.
>> So, the question is:
>> Can I myself (without contacting the hosting provider) create and use a
>> simple file on server, like "my.mdb", like a database, using vbscript?
>> If so, can You suggest a good site in order to get the beginning info?
>>
>> Thanks for any info.
>>
>>
>>
>>
>>
>
>



Re: create database with vbscript ? by Viatcheslav

Viatcheslav
Fri Oct 08 05:36:33 CDT 2004

You could create Access database like this:

dim dbFile
dbFile = "c:\temp\test.mdb"

dim connStr
dim cat
set cat = CreateObject("ADOX.Catalog")
connStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dbFile
cat.Create connStr
set cat = nothing

'Now use ADO to use this database

You may find many examples in ADO documentation, look for ado*.chm on your
hard drive or use MSDN (http://msdn.microsoft.com)

//------------------------------------
Regards,
Vassiliev V. V.
http://www-sharp.com -
Scripting/HTA/.Net Framework IDE

"BBB" <bb@takas.lt> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ:
news:%231rYtoRrEHA.1204@TK2MSFTNGP12.phx.gbl...
> Hi.
> Sorry for the maybe silly question.
> I am a newbe in vbscript. I have programmed with VB, VB .NET, PHP,
> JavaScript, but never with databases.
> Now I must to do some project where a database would be usefull.
> But the hosting plan which is chossed by my company
> doesn't include MySQL databases:(, so I cann't to use e.g. php for this
> purpose.
> So, the question is:
> Can I myself (without contacting the hosting provider) create and use a
> simple file on server, like "my.mdb", like a database, using vbscript?
> If so, can You suggest a good site in order to get the beginning info?
>
> Thanks for any info.
>
>
>
>
>



Re: create database with vbscript ? by Viatcheslav

Viatcheslav
Fri Oct 08 07:40:39 CDT 2004

No, ADO is not available on Unix, as well as VBScript can not work on Unix
if there are no special libraries installed.
Does your script run on Unix? If so, how do you execute it (ASP addon for
Apache or something other)?

What DBMS (databases) are available on your hosting plan?

//------------------------------------
Regards,
Vassiliev V. V.
http://www-sharp.com -
Scripting/HTA/.Net Framework IDE

"BBB" <bb@takas.lt> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ:
news:ujg34qSrEHA.376@TK2MSFTNGP14.phx.gbl...
> Thanks for reply.
> But what if I what to create "test.mdb" on server?
> I recieve "ActiveX component can't create object" error.
> Could ADO work on Unix server?
> What is the alternative for Microsoft technology?
>
>
>
> "Viatcheslav V. Vassiliev" <msnewsgroup@www-sharp.com> wrote in message
> news:u4XbzKSrEHA.516@TK2MSFTNGP09.phx.gbl...
> > You could create Access database like this:
> >
> > dim dbFile
> > dbFile = "c:\temp\test.mdb"
> >
> > dim connStr
> > dim cat
> > set cat = CreateObject("ADOX.Catalog")
> > connStr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & dbFile
> > cat.Create connStr
> > set cat = nothing
> >
> > 'Now use ADO to use this database
> >
> > You may find many examples in ADO documentation, look for ado*.chm on
your
> > hard drive or use MSDN (http://msdn.microsoft.com)
> >
> > //------------------------------------
> > Regards,
> > Vassiliev V. V.
> > http://www-sharp.com -
> > Scripting/HTA/.Net Framework IDE
> >
> > "BBB" <bb@takas.lt> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ:
> > news:%231rYtoRrEHA.1204@TK2MSFTNGP12.phx.gbl...
> >> Hi.
> >> Sorry for the maybe silly question.
> >> I am a newbe in vbscript. I have programmed with VB, VB .NET, PHP,
> >> JavaScript, but never with databases.
> >> Now I must to do some project where a database would be usefull.
> >> But the hosting plan which is chossed by my company
> >> doesn't include MySQL databases:(, so I cann't to use e.g. php for this
> >> purpose.
> >> So, the question is:
> >> Can I myself (without contacting the hosting provider) create and use a
> >> simple file on server, like "my.mdb", like a database, using vbscript?
> >> If so, can You suggest a good site in order to get the beginning info?
> >>
> >> Thanks for any info.
> >>
> >>
> >>
> >>
> >>
> >
> >
>
>



Re: create database with vbscript ? by BBB

BBB
Fri Oct 08 09:44:37 CDT 2004

This is a multi-part message in MIME format.

------=_NextPart_000_003C_01C4AD5E.7ACFB420
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

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>


------=_NextPart_000_003C_01C4AD5E.7ACFB420
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 6.00.2900.2180" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<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>&lt;script language=3DVBScript =
runat=3D"server"&gt;=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>&nbsp;set cat =3D=20
CreateObject("ADOX.Catalog")<BR>&nbsp;connStr =3D=20
"Provider=3DMicrosoft.Jet.OLEDB.4.0;Data Source=3D" &amp; =
dbFile<BR>&nbsp;cat.Create=20
connStr</FONT><BR><BR>So, after creation of "<FONT face=3D"Times New =
Roman"=20
size=3D3>testa.mdb", i have copied "testa.mdb" to my&nbsp;ftp =
server,&nbsp;and the=20
file is available at <FONT face=3DArial size=3D2>exactly=20
"http://www.mysite.lt/folder1/testa.mdb"</FONT>&nbsp;</FONT></FONT></P>
<P><FONT face=3DArial size=3D2>But when<EM>&nbsp;I&nbsp;execute </EM>the =
script=20
above&nbsp;on the remote server,&nbsp;(...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"&nbsp;&nbsp;&nbsp;&nbsp; ?? But the =
file=20
exists!!!<BR>What's the problem?.</FONT></P>
<P><FONT face=3DArial =
size=3D2>&lt;/script&gt;<BR></P></FONT></BODY></HTML>

------=_NextPart_000_003C_01C4AD5E.7ACFB420--


Re: create database with vbscript ? by McKirahan

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" &lt;<A href=3D"mailto:bb@takas.lt">bb@takas.lt</A>&gt; =
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>&lt;script language=3DVBScript =
runat=3D"server"&gt;=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>&nbsp;set cat =3D=20
CreateObject("ADOX.Catalog")<BR>&nbsp;connStr =3D=20
"Provider=3DMicrosoft.Jet.OLEDB.4.0;Data Source=3D" &amp;=20
dbFile<BR>&nbsp;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&nbsp;ftp server,&nbsp;and the file is available at <FONT =
face=3DArial=20
size=3D2>exactly=20
=
"http://www.mysite.lt/folder1/testa.mdb"</FONT>&nbsp;</FONT></FONT></P>
<P><FONT face=3DArial size=3D2>But when<EM>&nbsp;I&nbsp;execute =
</EM>the script=20
above&nbsp;on the remote server,&nbsp;(...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"&nbsp;&nbsp;&nbsp;&nbsp; ?? But the =
file=20
exists!!!<BR>What's the problem?.</FONT></P>
<P><FONT face=3DArial size=3D2>&lt;/script&gt;<BR></FONT></P>
<P><FONT face=3DArial size=3D2>1)&nbsp;&nbsp;&nbsp; Post in plain =
text.</FONT></P>
<P><FONT face=3DArial size=3D2>2)&nbsp;&nbsp;&nbsp; you can't =
reference the=20
database via a URL.</FONT></P>
<P><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; a)&nbsp;&nbsp;&nbsp; =
Use either=20
Server.MapPath() ot the full physical path:</FONT></P>
<P><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;=20
Server.MapPath(testa.mdb)</FONT></P>
<P><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp;=20
&nbsp;&nbsp;&nbsp;&nbsp;c:\inetpub\wwwroot\folder\testa.mdb</FONT></P>
<P><FONT face=3DArial><FONT size=3D2>&nbsp;&nbsp;&nbsp; =
b)&nbsp;&nbsp;&nbsp; Use a=20
DSN-less connection:</FONT></FONT></P>
<P><FONT face=3DArial size=3D2>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; =
Const cDSN =3D=20
"Provider=3DMicrosoft.Jet.OLEDB.4.0;Data Source=3D"</FONT></P>
<P><FONT face=3DArial><FONT size=3D2>&nbsp;&nbsp;&nbsp; =
&nbsp;</FONT><FONT=20
face=3DArial><FONT size=3D2>&nbsp;&nbsp;&nbsp; conn.Open cDSN &amp;=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)&nbsp;&nbsp;&nbsp; Read to other =
responses as I=20
may have left something out.</FONT></P></BLOCKQUOTE></BODY></HTML>

------=_NextPart_000_0039_01C4AD30.13984C00--


Re: create database with vbscript ? by BBB

BBB
Sat Oct 09 11:44:45 CDT 2004

Ok, but after using
conn.Open cDSN & Server.MapPath(testa.mdb)
I get error
object required "Server".




Re: create database with vbscript ? by Viatcheslav

Viatcheslav
Sat Oct 09 12:20:41 CDT 2004

Do you run script on Unix server? If so, what is script engine (the name of
component that executes VBScript)? Most probable, you will not be able to
use MS Access database on Unix server.

//------------------------------------
Regards,
Vassiliev V. V.
http://www-sharp.com -
Scripting/HTA/.Net Framework IDE

"BBB" <bb@takas.lt> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ:
news:Ojg5X8hrEHA.2008@TK2MSFTNGP12.phx.gbl...
> Ok, but after using
> conn.Open cDSN & Server.MapPath(testa.mdb)
> I get error
> object required "Server".
>
>
>



Re: create database with vbscript ? by BBB

BBB
Sat Oct 09 12:52:29 CDT 2004

The server of my web hosting provider is Unix.
But what do You mean "script engine"? I don't know.

I made a request to the ISP Information department, asking for more
technical details. Now I am waiting for the answer about posibilities to use
other type of databases.




Re: create database with vbscript ? by McKirahan

McKirahan
Sat Oct 09 13:31:44 CDT 2004

"BBB" <bb@takas.lt> wrote in message
news:Ojg5X8hrEHA.2008@TK2MSFTNGP12.phx.gbl...
> Ok, but after using
> conn.Open cDSN & Server.MapPath(testa.mdb)
> I get error
> object required "Server".


Sorry, remove "Server."; that's for ASP pages.



Re: create database with vbscript ? by Viatcheslav

Viatcheslav
Sun Oct 10 04:54:06 CDT 2004

Script engine is component (program) that runs VBScript. VBScript is not
supported by default in Unix, so there should be some component that runs
your script - documentation for this component should give you more
understanding about what can and what can not be done. VBScript on Unix will
not be completely compatible with VBScript on Windows and you will not be
able to use most components that are available on Windows - for example, as
you write, you can not access Server object.

//------------------------------------
Regards,
Vassiliev V. V.
http://www-sharp.com -
Scripting/HTA/.Net Framework IDE

"BBB" <bb@takas.lt> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ:
news:ObSwNiirEHA.2724@TK2MSFTNGP14.phx.gbl...
> The server of my web hosting provider is Unix.
> But what do You mean "script engine"? I don't know.
>
> I made a request to the ISP Information department, asking for more
> technical details. Now I am waiting for the answer about posibilities to
use
> other type of databases.
>
>
>



Re: create database with vbscript ? by BBB

BBB
Sun Oct 10 10:22:07 CDT 2004

Then, what's the alternative?
What kind of databases is it possible to use on Unix server without having
any special drivers or components?
Oracle or dBase?



Re: create database with vbscript ? by Viatcheslav

Viatcheslav
Sun Oct 10 11:43:05 CDT 2004

Many (most) Unix/Linux installations include MySQL and PostgreSQL. Most
hostings include MySQL but not PostgreSQL, but if it is not included into
hosting plan you should contact your hosting provider and ask what you could
use.

//------------------------------------
Regards,
Vassiliev V. V.
http://www-sharp.com -
Scripting/HTA/.Net Framework IDE

"BBB" <bb@takas.lt> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ:
news:%23kFn1ytrEHA.3488@TK2MSFTNGP11.phx.gbl...
> Then, what's the alternative?
> What kind of databases is it possible to use on Unix server without having
> any special drivers or components?
> Oracle or dBase?
>
>



Re: create database with vbscript ? by BBB

BBB
Sun Oct 10 12:38:18 CDT 2004

OK, thanks.



Re: create database with vbscript ? by Jim

Jim
Thu Oct 14 09:30:29 CDT 2004

BBB wrote:

> Hi.
> Sorry for the maybe silly question.
> I am a newbe in vbscript. I have programmed with VB, VB .NET, PHP,
> JavaScript, but never with databases.
> Now I must to do some project where a database would be usefull.
> But the hosting plan which is chossed by my company
> doesn't include MySQL databases:(, so I cann't to use e.g. php for this
> purpose.
> So, the question is:
> Can I myself (without contacting the hosting provider) create and use a
> simple file on server, like "my.mdb", like a database, using vbscript?
> If so, can You suggest a good site in order to get the beginning info?
>
> Thanks for any info.
>
>
>
>
>
Download sample eCommerce
system from VPASP.COM
It shows everything you need to
know here.