Hello, mbatestblrock. I am one of the ASP Experts Mary spoke of above.
I have read through this entire thread, and perhaps I've missed something here because that was quite a bit to read; so if i have missed something please excuse my ignorance. The first question I have for you is:
Why are you transferring the data from the text files to access? You are effectively transferring one data store to another.
If there is no "technical" reason why you're moving the data from the text fles to access, I would use ASP's FileSystemObjec t to simply access the data directly from the text files without using access. Using the FSO you can read the name of the file EX: store123.txt - and output this on the page. This would be very effective in solving the problem of not being able to get the store name - if it is in the filename of the file - asp can grab this for you and display it. You could also use it to read the contents of the text file line by line, checking to see what the status of the store is (backup or what have you) - and output the storename and status of the store.
For instance...
Store1: ALERT! USING BACKUP!
Store2: Nominal
Store3: Nominal
Store4: Nominal
Store5: Nominal
Store6: Nominal
Let me know first if there is anything stopping you from doing this, and if there isn't, i will write a script for you to accomplish this task. Just be sure to send me an example of one of these text files over PM if you can, so I know what I am working with.
Secondly, if you wish to use the function mary created instead, below is the ASP version of it.
[CODE=ASP]
Function appendToTable(t blName)
sSQL = "SELECT * FROM " & tblName
Set rs = Server.CreateOb ject("ADODB.Rec ordSet")
rs.Open sSQL,cnn,3,3 ' cnn is, of course, the connection to your database.
' this will append each record from the passed table name to the tmpTable
Do Until rs.EOF
' Each field name will have to be specified.
' For the purposes of examples I am just going to use 3 and show
' how to pass different value types. The first is a String, the second
' a date and the third a number.
cnn.execute("IN SERT INTO tmpTable (FieldName1, FieldName2, FieldName3) " & _
"VALUES ('" & rs("FieldName1" ) & "', #" & rs("FieldName1" ) & "#, " & rs("FieldName1" ) & ")")
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
End Function
[/CODE]
I have read through this entire thread, and perhaps I've missed something here because that was quite a bit to read; so if i have missed something please excuse my ignorance. The first question I have for you is:
Why are you transferring the data from the text files to access? You are effectively transferring one data store to another.
If there is no "technical" reason why you're moving the data from the text fles to access, I would use ASP's FileSystemObjec t to simply access the data directly from the text files without using access. Using the FSO you can read the name of the file EX: store123.txt - and output this on the page. This would be very effective in solving the problem of not being able to get the store name - if it is in the filename of the file - asp can grab this for you and display it. You could also use it to read the contents of the text file line by line, checking to see what the status of the store is (backup or what have you) - and output the storename and status of the store.
For instance...
Store1: ALERT! USING BACKUP!
Store2: Nominal
Store3: Nominal
Store4: Nominal
Store5: Nominal
Store6: Nominal
Let me know first if there is anything stopping you from doing this, and if there isn't, i will write a script for you to accomplish this task. Just be sure to send me an example of one of these text files over PM if you can, so I know what I am working with.
Secondly, if you wish to use the function mary created instead, below is the ASP version of it.
[CODE=ASP]
Function appendToTable(t blName)
sSQL = "SELECT * FROM " & tblName
Set rs = Server.CreateOb ject("ADODB.Rec ordSet")
rs.Open sSQL,cnn,3,3 ' cnn is, of course, the connection to your database.
' this will append each record from the passed table name to the tmpTable
Do Until rs.EOF
' Each field name will have to be specified.
' For the purposes of examples I am just going to use 3 and show
' how to pass different value types. The first is a String, the second
' a date and the third a number.
cnn.execute("IN SERT INTO tmpTable (FieldName1, FieldName2, FieldName3) " & _
"VALUES ('" & rs("FieldName1" ) & "', #" & rs("FieldName1" ) & "#, " & rs("FieldName1" ) & ")")
rs.MoveNext
Loop
rs.Close
Set rs = Nothing
End Function
[/CODE]
Comment