Experts Exchange connects you with the people and services you need so you can get back to work.
Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
If not objFSO is nothing then
set objStream = objFSO.OpenTextFile(filepath & "\" & filename,1, False) ' 1 = ForReading
lineCount = 1
do while not objStream.AtEndOfStream
If lineCount > 1 Then ' ignoring first line as it contains header info
arrLine = Split(sBuffer, ",")
sql = "INSERT INTO Contacts (UserId, FirstName, LastName, Email, Country, Company) VALUES (" & Session("userid") & ", "
For X = 0 To Ubound(arrLine)
sql = sql & "'" & SanitizeSQL(arrLine(X)) & "'"
If X <> Ubound(arrLine) Then
sql = sql & ","
sql = sql & ");"
response.Write(sql & "<br>")
lineCount = lineCount + 1
Set objFSO = Nothing
Open in new window
Set Conn = Server.CreateObject("ADODB.Connection")
Set RS = Server.CreateObject("ADODB.Recordset")
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & filepath & ";Extended Properties='Text;HDR=YES;FMT=Delimited'"
sSQL="SELECT * FROM [" & filename & "]"
set RS = Conn.Execute (sSQL)
While NOT RS.EOF
cn.Execute("INSERT INTO Contacts (UserId, FirstName, LastName, Email, Country, Company) " & _
"VALUES (" & Session("userid") & ", '" & SanitizeSQL(RS("FirstName")) & "', '" & SanitizeSQL(RS("LastName")) & "', '" & SanitizeSQL(RS("EmailAddress")) & "', '" & SanitizeSQL(RS("HomeCountry")) & "', '" & SanitizeSQL(RS("Company")) & "')")
set RS = NOTHING
set Conn = NOTHING
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.