Hi im having trouble creating a MS Access Databse using ASP.

Scenario: When a user registers, i want to be able to create an MS access database.

Here is a little code im using..

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
 <!--#include virtual="Includes/adovbs.inc"-->
 <%
 Dim sDatabaseName
 sDatabaseName = "\access_db\MyNewDatabase.mdb" 
 
 Sub CreateAccessDatabase(sDatabaseToCreate)
  Dim catNewDB ' As ADOX.Catalog
  Set catNewDB = Server.CreateObject("ADOX.Catalog")
  catNewDB.Create ("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & sDatabaseToCreate & ";Jet OLEDB:Engine Type=5;")
 
  Set catNewDB = Nothing
 End Sub 
 
 CreateAccessDatabase sDatabaseName
 
 Response.Write("Database has been created successfully!")
 %>

Im having some trouble (eg. valid path), does anyone have any suggestion(s) or different code which might solve my problem? (only using asp)

Thanks.

Sorry fixed the problem. For some reason i need to use the FULL relative path.

Hope this post might help other with similar problems. :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.