Ask a Question related to ASP Database, Design and Development.
-
Mike Combe #1
How to connect to ASCII database file via ADODB?
How to connect to ASCII database file via ADODB?
Hello,
I have received an ASCII database file.
I would like to connect & read the ASCII file via ADODB.....
Here is a portion of the ASCII file....
"ListingID"|"OfficeID"|"Active"|"ListingType"|
790144|1002001|False|"Single Family"|
The first line does contain the column name.
The content contains the ("") double quote characters....and
some of the values do not contain the duble quote characters.
Therefore I do not have a "comma delimited ascii." file.
Here is the code I'm trying to use....
This is the "CSV.dsn" file........
[ODBC]
DRIVER=Microsoft Text Driver (*.txt; *.csv)
UID=admin
UserCommitSync=Yes
Threads=3
SafeTransactions=0
PageTimeout=5
MaxScanRows=25
MaxBufferSize=512
ImplicitCommitSync=Yes
FIL=text
Extensions=txt,csv,tab,asc
DriverId=27
This is code from my .ASP page.....
sDSNFile = "CSV.dsn"
sPath = Server.MapPath(sScriptDir) & "\"
sDSN = "FileDSN=" & sPath & sDSNFile & _ ";DefaultDir=" & sPath & _ ";DBQ="
& sPath & ";"
Set db = Server.CreateObject("ADODB.Connection")
db.Open sDSN
mySQL = "SELECT * FROM " & curFilename
set rs = db.execute(mySQL)
do while NOT rs.EOF
Response.Write "ListingID: " & rs("ListingID")
rs.MoveNext
rs.close
db.close
set rs = nothing
set db = nothing
My .ASP code works just great if all field values were contained within the
("") double quote characters. But when I use the ASCII file mentioned
above.....I get unexpected results.
What do I need to modify......in order to read an ASCII file that is not
just "comma delimited ascii."
Thanks in advanced for any help or tips....
--- Mike Combe
[email]mike1@e-zsoftware.com[/email]
7/1/2003
Mike Combe Guest
-
How to connect to database using php
Im new to data input using flash, can someone please tell me how to connect to a mysql database. -
Remove ascii code from a certain position in file
I'm very familiar with the tr command and use it a lot when removing certain characters from files, but my situation today is involving needing to... -
How to use “RDS.Connect” to connect to a MS Access database?
The example I am working from uses the following code which does not work: RDS.Connect = "Provider='sqloledb';Integrated Security='SSPI';Initial ... -
How do I make AI file print as ASCII?
Some of my Illustrator files print fine while other print out as garbage text. In Quark I can change the file type from Binary to ASCII. Can this be... -
check whether file is ascii or ebcdic
Hi How do I check whether a file is in ebcdic or ascii format ? Thanks, Nitish



Reply With Quote

