Use command object to do that.
oCmd = CREATEOBJECT("Adodb.Command")
oCmd.ActiveConnection = oCon
oCmd.CommandText = "create table #temp1(age int)"
oCmd.Execute()
oCmd.CommandText = "Select * From #temp1"
oRS = CreateObject( "adodb.recordset" )
oRs.ActiveConnection = oCon
oRs = oCmd.Execute()
>Hi I am trying to create a temporary table via ado with the following statement, which I pass to the execute method
>
>create table #temp1(age int)
>
>The temp table is being created.
>
>I am then trying to select from this temp table, with a simple select statement
>
>select * from #temp1
>
>I then get an error that the table can not be found.
>
>So I tried to qualify the table name with the database name
>
>select * from tempdb..#temp1
>
>But this does not work either.
>
>
>Doe anyone have any idea how to do this
>
>Hope you can help
>
>Regards
>Steven
--sb--