SteveS
Posts: 41
|
Posted: 04/01/2004, 5:32 AM |
|
Hi,
I have imported data from a CSV file into a temporary table, however, I cannot seem to get the data from the temporary table to the 'master' table. Code as follows:
<%
'Making a connection with the database
set objConn= Server.CreateObject("ADODB.Connection")
strDBPath = Server.MapPath("./test.mdb")
objConn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & ";"
' Path of the CSV file
Dim csv_path
csv_path = Server.MapPath("./") & "\"
On Error Resume Next
SQL = "DROP TABLE temp"
objConn.Execute SQL
SQL = "SELECT * INTO temp FROM [import.csv] IN """ & csv_path & """ ""TEXT;"""
'SQL = "INSERT INTO temp SELECT * FROM [import.csv] IN """ & csv_path & """ ""TEXT;"""
'Executing the SQL Statement
objConn.Execute SQL
' Transfer data in temp table to main pupil_names table
<<< what should go here?? >>>
objConn.Close
Set objConn = Nothing
response.write("End of procedure")
%>
|
|
|
peterr
Posts: 5971
|
Posted: 04/01/2004, 12:19 PM |
|
Since this is a generic question it may be faster for you to lookup an answer, rather than wait for it.
See: http://www.google.com/search?q=sql+copy+records+between+tables+access http://groups.google.com/groups?q=sql%20copy%20records%...tables%20access
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com |
|
|
|