|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
create table in ms access using ado
hi, im trying to automate the creation of a table in ms access through ASP ado--can i embed the sql in the adodb command object to do this?..does it support the create command.. i keep getting a syntex error w/ the following code:
======================================= dim strConnectionform4 strConnectform4 = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=C:\Inetpub\wwwroot\datastores\calander.mdb; Persist Security Info=False" Dim objCommandform4, objRSform4, qrystrform4, intnoofrecs4 Set objCommandform4 = Server.CreateObject("ADODB.Command") qrystrform4 = "create table test_copy as select * from cal_template" objCommandform4.ActiveConnection = strConnectform4 objCommandform4.CommandText = qrystrform4 objCommandform4.CommandType = adCmdText set objRSform4 = objCommandform4.Execute set objCommandform4 = Nothing ==================================== Error Type: Microsoft JET Database Engine (0x80040E14) Syntax error in CREATE TABLE statement. /main/reg_comp.asp, line 55 |
|
#2
|
|||
|
|||
|
no, that isn't going to work. you can't create a table that way. the select statement isn't going to return:
(field, field, field) values (value, value, value) it will return a record/recordset. if ou want to do it that way, you'll have to put your select data into a recordset and then sort it out into a string to use for your create table statement |
|
#3
|
|||
|
|||
|
Create SQL DB Programmatically in VB.NET with ADO
Check this article out:
URL |
|
#4
|
|||
|
|||
|
Quote:
Try this command for creating Table : qrystrform4 = "select * from cal_template into test_copy" |
![]() |
| Viewing: Dev Articles Community Forums > Databases > Microsoft Access Development > create table in ms access using ado |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|