select into sql statement not working - pls help 
Author Message
 select into sql statement not working - pls help

Hi ... I am attempting to create a database that copies over a table
from a main database to another database (name of the new database is
in the variable Filename).

Here is my code... I keep getting an error message that says:

"Query input must contain at least one table or query"

          Set MyDB = Workspaces(0).OpenDatabase("MAIN.MDB")
          Set MyDB2 = Workspaces(0).CreateDatabase(Filename,
dbLangGeneral)
          MyDB.Execute "SELECT * INTO [Personal] IN " + Filename + "
FROM [Personal]"

I'm hoping that you can help me with my select statement... thanks!

Thanks,

Kevin



Tue, 20 Jun 2000 03:00:00 GMT  
 select into sql statement not working - pls help



Quote:
>Hi ... I am attempting to create a database that copies over a table
>from a main database to another database (name of the new database is
>in the variable Filename).

>Here is my code... I keep getting an error message that says:

>"Query input must contain at least one table or query"

>          Set MyDB = Workspaces(0).OpenDatabase("MAIN.MDB")
>          Set MyDB2 = Workspaces(0).CreateDatabase(Filename,
>dbLangGeneral)
>          MyDB.Execute "SELECT * INTO [Personal] IN " + Filename + "
>FROM [Personal]"

>I'm hoping that you can help me with my select statement... thanks!

>Thanks,

>Kevin

Kevin

just tried your bit of code (see below), works fine for me - 32bit vb4.
Have you actually got a table called PERSONAL in main.mdb?

Sub Main()
    ChDrive App.Path
    ChDir App.Path
    Dim filename As String
    filename = "John.mdb"

    Set MyDB = Workspaces(0).OpenDatabase("test.MDB")
    Set MyDB2 = Workspaces(0).CreateDatabase(filename, dbLangGeneral)
    MyDB.Execute "SELECT * INTO [Personal] IN " + filename + " FROM
[Personal]"

End Sub
--
John McGuire



Wed, 28 Jun 2000 03:00:00 GMT  
 select into sql statement not working - pls help

Hi John... I actually got it working.. I deleted it (a few times) and
retyped it and it worked... wierd, but thanks  for your help!  Kevin

Quote:



>>Hi ... I am attempting to create a database that copies over a table
>>from a main database to another database (name of the new database is
>>in the variable Filename).

>>Here is my code... I keep getting an error message that says:

>>"Query input must contain at least one table or query"

>>          Set MyDB = Workspaces(0).OpenDatabase("MAIN.MDB")
>>          Set MyDB2 = Workspaces(0).CreateDatabase(Filename,
>>dbLangGeneral)
>>          MyDB.Execute "SELECT * INTO [Personal] IN " + Filename + "
>>FROM [Personal]"

>>I'm hoping that you can help me with my select statement... thanks!

>>Thanks,

>>Kevin

>Kevin
>just tried your bit of code (see below), works fine for me - 32bit vb4.
>Have you actually got a table called PERSONAL in main.mdb?
>Sub Main()
>    ChDrive App.Path
>    ChDir App.Path
>    Dim filename As String
>    filename = "John.mdb"

>    Set MyDB = Workspaces(0).OpenDatabase("test.MDB")
>    Set MyDB2 = Workspaces(0).CreateDatabase(filename, dbLangGeneral)
>    MyDB.Execute "SELECT * INTO [Personal] IN " + filename + " FROM
>[Personal]"
>End Sub
>--
>John McGuire



Wed, 05 Jul 2000 03:00:00 GMT  
 select into sql statement not working - pls help

In the future forget the * thats what pussels Jet.

Niels



Fri, 07 Jul 2000 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Pls Help: SQL Statement and "'

2. sql statement error! pls help

3. Pls Help: SQL Statement and "'

4. sql statement error! pls help

5. select statement with distinct not working

6. .addnew method ADO does not work pls help

7. POST method NOT WORKING... pls help

8. NetFileClose is not working...pls help!!

9. Pairwise Sql statement not working in Access ?

10. SQL statement not working

11. sql statements delete and insert not working

12. SQL statement not working!

 

 
Powered by phpBB® Forum Software