please explain query (how it works)

  • Thread starter Akshay Harsulkar
  • Start date
A

Akshay Harsulkar

Please see following.

pTemp is pointer to _Connection. _Connection Class of ADO

CComVariant vd;
hr = pTemp->Execute(bstrSql, &vd, adExecuteNoRecords, NULL);

where bstrSql = 'Select * into invoice from Test;Database
=C:\Temp\100Invoice.txt'

Could you please explainthe query, what it does and how?
As per my understanding, it dumps contecntas of 100Invoice.txt to table
invoice. but how?
 
J

Jeff Boyce

As I read the SQL statement, "stick everything in [Test] into [invoice]"...

Good luck

Jeff Boyce
<Access MVP>
 
P

peregenem

Akshay said:
where bstrSql = 'Select * into invoice from Test;Database
=C:\Temp\100Invoice.txt'

Are you sure you got the SQL correct? I'd expect it to read more like

SELECT *
INTO invoice
FROM [TEXT;DATABASE=C:\Temp\;].100Invoice.txt;
As per my understanding, it dumps contecntas of 100Invoice.txt to table
invoice. but how?

The above is Jet SQL syntax. The text to the left of the point is the
'database', the text to the right is the 'table'. The 'database' in
this case is a connection string which uses an MS odbc text driver,
specifying the source folder. The 'table' is the filename of a text
document. The SELECT...INTO...FROM Jet SQL syntax creates the table on
the fly. How? Due to the brilliance of the Jet programmers :)
 
Top