|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
|||
|
|||
|
Is it possible to add tables to a MSAccess Database using ADO in ASP? That means in an ASP script. Is it?
thanks, ben. |
|
#2
|
|||
|
|||
|
Actually you'll need to use SQL to create your TABLE.
Look into CREATE TABLE....syntax something like: strSql = "CREATE TABLE..." objConn.Execute strSql .... Hope this helps! Sincerely Vlince |
|
#3
|
|||
|
|||
|
Thanks.
But I stil have a problem, I learned the syntax of the CREATE TABLE statment but I don't know how to defiene a Autonumber Feild, The syntax is like this: sql = "CREATE TABLE tblname(Feildname FEILDTYPE, Feildname FEILDTYPE...)" conn.Execute sql now if I write TEXT in the feildtype it works, but if I type AUTONUMBER in the feildtype an error is executed that says: " Microsoft OLE DB Provider for ODBC Drivers error '80040e14' [Microsoft][ODBC Microsoft Access Driver] Syntax error in field definition. /tests/DBR/ct.asp, line 11 " Is their a way to set a feild to AUTONUMBER? |
|
#4
|
|||
|
|||
|
I found this example googling on the web and look what I've found
CREATE TABLE tblContacts2 ( ID COUNTER, LastName CHAR(40), FirstName CHAR(40), HomePhone CHAR(40), WorkPhone CHAR(40), Fax CHAR(40), Email CHAR(40), Address1 CHAR(40), Address2 CHAR(40), City CHAR(30), State CHAR(10), ZipCode CHAR(20), CONSTRAINT ID_PK PRIMARY KEY(ID) ) That is just an example Hope this helps! Sincerely Vlince |
|
#5
|
|||
|
|||
|
Code:
CREATE TABLE mytable
(
myfield INTEGER NOT NULL IDENTITY (1, 1) CONSTRAINT pk_myfield PRIMARY KEY
)
|
|
#6
|
|||
|
|||
|
Tanks guy it worked!
I wrote the ID as Counter TYPE and it is an AUTONUMBER Type by MS Access, so thanks.... |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ASP Programming > Adding Tables to a database |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|