|
-
August 16th, 1999, 09:55 AM
#1
Cannot Open RecordSet
Hi,
why do I get this error, What can I do ?
Thanks
cmd.CommandType = adCmdText
Set cmd.ActiveConnection = cnnMyConnection
cmd.CommandText = "Create Table MyTable "
Set rsTable = cmd.Execute
rsTable.AddNew
----ERROR: Object is closed ?????
rsTable.Fields("Name") = "Kathy"
rsTable.Fields("City") = "Montreal"
-
August 16th, 1999, 10:09 AM
#2
Re: Cannot Open RecordSet
IMHO this should rather look like this:
cmd.CommandType = adCmdText
set cmd.ActiveConnection = cnnMyConnection
cmd.CommandText = "Create Table MyTable "
' create the table
cmd.Execute
' now open a recordset
cmd.commandtext = "select * from mytable"
set rsTable = cmd.Execute
...
-
August 16th, 1999, 10:31 AM
#3
Re: Cannot Open RecordSet
At the second .Execute :
I've got error "Could not find MyTable"
Looks like the first Excecute does not work
-
August 16th, 1999, 11:02 AM
#4
Re: Cannot Open RecordSet
well, I thought that your statement was meant as an example.
Of course "Create table mytable" is not valid SQL. You need to specify the fields of your table as in:
create table mytable(firstfield char(20))
Also, check all errors that you get when executing a statement.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|