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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Transferdatabase from sql string

Status
Not open for further replies.

GooGoocluster

Technical User
May 12, 2005
71
US
I could not find anything on this, I need to know if this is possible.

I need to run code that converts a SQL string to a .dbf



like:

SQLstring = Select * FROM Forms!frmName!cboName Where This= cboName2

transferdatabase acExport, "dBase 5.0", name, SQLstring, blah, blah
 
Is dBase 5 like III and IV in that the database comprises a set of .dbf (and related) files in a directory? If so, I can probably give you a line. No matter what dBase 5 is like, you will need a QueryDef, I think:
Code:
Dim qdf As DAO.QueryDef
Dim strSQL As String

'Assuming This is text
strSQL = "Select * FROM " & Forms!frmName!cboName & " Where This= '" & cboName2 & "'" 

Set qdf = CurrentDb.CreateQueryDef("qryQueryName", strSQL)

You can then export qryQueryName.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top