Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"Invalid Argument" error message

Status
Not open for further replies.

Crevalle

Technical User
Aug 16, 2004
36
0
0
US
When I attempt to run a make-table query, I get this message. I read that it may be due to overly large tables?

The make-table query I am running should create around 200,000 rows, so this may be the issue???

I appear to have the newest update packs. I attempted to compact the database, but it's been running for over 30 minutes, and task manager says it is not responding.

Any ideas?
 
Crevalle,
You "MAY" have better luck if you do this by creating a VBA subroutine, This code will open the connection for you.
Paste this in a module. Then insert your Make Table SQL statement from your Query.

Code:
Public Sub MakeATable()
    Dim Conn2 As ADODB.Connection
    Dim Rs1 As ADODB.Recordset
    Dim SQLCode As String
    Set Conn2 = CurrentProject.Connection  ' <<<<Note same as CurrentDb
    Set Rs1 = New ADODB.Recordset
    
    ' Crevalle,
    ' note copy the SQL code from your make table query in between the quote
    ' something like this example below
    ' SQLCode = "SELECT yourTable.Yourfields INTO NewTableName FROM yourTable;"

    SQLCode = ""         ' <<<<<< Crevalle, put your SQL code here
    
    Rs1.Open SQLCode, Conn2, adOpenStatic, adLockOptimistic

    Set Rs1 = Nothing
    Set Conn2 = Nothing
    
    ' Crevalle,
    ' Press Ctrl-G to bring up the Immediate window
    ' and paste this in it  >>>>     MakeATable    and press Enter key

End Sub

It will take a while but at least you don't have the QBE GUI interfering with it as well.


DougP, MCP, A+
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top