i nv learn sql b4..alright alright, let me tell u exactly wat i wan. basically, my application run then lastly it iwl write the result into the text file which i last shown u. now wat i wan is, to write another code and ask the system to read the text file (which is done already) and store it into the access database. my database name is Quiz.mdb tat come wif a table name "marks" wif 3 columns namely "question", "date", "time". now the thing i wan is to read from text file and store it into the database.
WrongQuestion.txt
1,2,3,4,5,6,7,8,9,10
11/19/2007
3:29:30 PM
ReadText.asp
<html>
<body>
<%
Dim adoCon
Dim rsAdd
Dim strSQL
Set adoCon = Server.CreateObject("ADODB.Connection")
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("Quiz.mdb")
'adoCon.Open "DSN=Quiz"
Set rsAdd = Server.CreateObject("ADODB.Recordset")
Set FS = Server.CreateObject("Scripting.FileSystemObject")
'response.Write Server.MapPath("WrongQuestion.txt")
Set RS = FS.OpenTextFile(Server.MapPath("WrongQuestion.txt"),1)
While not rs.AtEndOfStream
'Response.Write RS.ReadLine
'Response.Write("<br />")
strSQL = "insert into marks(question, date, time) VALUES ('" & value1 &"','"&value2&"','"&value3&"'"
rsAdd.Update strSQL, adoCon
Wend
rsAdd.Close
Set rsAdd = Nothing
Set adoCon = Nothing
Set FS = Nothing
Set RS = Nothing
%>
</body>
</html
No one has replied yet! Why not be the first?
Sign in or Join us (it's free).