Is it possible to create a database file, like Access, by using a script
language? Thanks.

Re: Can I create a database file by using VB script? by Bob

Bob
Wed Oct 22 11:01:50 CDT 2003

mizi wrote:
> Is it possible to create a database file, like Access, by using a
> script language? Thanks.

http://www.aspfaq.com/show.asp?id=2029

HTH,
Bob Barrows

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.



Can I create a database file by using VB script? by Bryan

Bryan
Thu Oct 23 15:50:45 CDT 2003

I'm thinking it's possible using ADO but not easy. I
would pursue a book on ADO or try MSDN's ADO docs on-line
for more info. I checked some of my scripting books and
none open the topic, but I recall in my VBA days doing old
DAO stuff that you could make ANYTHING in a database
system including tables, fields, indexes and even the
database itself potentially.

Your next challenge would be defining the DSN so you could
access it easily. That's the one I'm trying to master. I
can get to DSNs using WMI (also read-up-able on MSDNs
site) but I don't seem to be able to articulate the custom-
build DSNs.

Good luck.
BK
>-----Original Message-----
>Is it possible to create a database file, like Access, by
using a script
>language? Thanks.
>.
>

Re: Can I create a database file by using VB script? by Ross

Ross
Fri Oct 24 13:07:31 CDT 2003

"Bryan Kramer" <bryanekramer@msn.com> wrote in news:052001c399a7$547fb6b0$a101280a@phx.gbl:

> I'm thinking it's possible using ADO but not easy.

It's not really hard, as long as you have a recent MDAC installed.

function CreateAndOpenAccessFile(strPathname,strTable)
Dim theCatalog, theConnection
Set theCatalog = createobject("ADOX.Catalog")
theCatalog.Create _
"Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Engine Type=5;Data Source='" _
& strPathname
Set theCatalog = Nothing
Set theConnection = createobject("ADO.Connection")
theConnection.Open _
"Provider=Microsoft.Jet.OLEDB.4.0;Jet OLEDB:Engine Type=5;Data Source='" _
& strPathname
theConnection.execute "CREATE TABLE " & strTable & " (ID counter, NAME varchar(50));"
Set CreateAndOpenAccessFile = theConnection
end function

> Your next challenge would be defining the DSN so you could
> access it easily. That's the one I'm trying to master. I
> can get to DSNs using WMI (also read-up-able on MSDNs
> site) but I don't seem to be able to articulate the custom-
> build DSNs.