Create a table in Access inside ASP

Results 1 to 2 of 2

Thread: Create a table in Access inside ASP

  1. #1
    Join Date
    Dec 1969

    Default Create a table in Access inside ASP

    Usually we create a table in access in advance<BR>but in this case, i want to create a table in access<BR>when user enter the asp page after checking their id. so a table will be created for the user to further use. <BR>but I didn&#039t find the code of create a table,<BR>so any one can give a hand?<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Create a table in Access inside ASP

    &#039 DSNless connection to Access Database<BR> set conntemp = server.createobject("adodb.connection")<BR> conntemp.Open "PROVIDER=MSDASQL;" & _<BR> "DRIVER={Microsoft Access Driver (*.mdb)};" & _<BR> "DBQ=C:locationdbname.mdb;" & _<BR> "UID=;PWD=;" <BR><BR>&#039 Fetch the data from the table to see if it exists<BR> mySQL="select * from tablename"<BR> set rstemp=conntemp.execute(mySQL)<BR><BR>&#039 this code detects if a table exists if not create it<BR> if rstemp.eof then<BR> &#039 Create the table with fields.<BR> conntemp.execute "CREATE TABLE tablename" _<BR> & " (field1 TEXT, field2 number, etc.);"<BR> end if <BR>DBQ= is your path to your database. tablename is the name you give the table and don&#039t forget to cleanup the resources.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts