This topic is locked

Create Table

2/16/2008 11:25:50 PM
ASPRunnerPro General questions
T
trekereric author

I have a database of questions that an administrator can select questions and print out in a form of a test. I would like to create a button that in stead of printing the test, I would like the button to create a table and allow selected users to access only the new table (on-line testing). I will create a web-page that will work with the new table. Can someone help with the code for this?

J
Jane 2/19/2008

Eric,
you can do the following:

  1. proceed to the Visual Editor tab,
  2. turn on HTML mode, find this line:
    <!-- delete form -->



and add following code just before:

<A onclick="frmAdmin.a.value='update'; frmAdmin.submit(); return false;" href="TableName_list.htm#">Create table</A>


3. proceed to the Events tab and add your code to the Before record deleted event.

Here is a sample code:

'Delete selected records

if Request.Form("a") = "delete" then

BeforeDelete = True

exit function

end if
'create table

strCreate = "create NewTableName"

dbConnection.Execute strCreate

'add another actions here

BeforeDelete = False

End Function