Tables in a CSV Database

Results 1 to 2 of 2

Thread: Tables in a CSV Database

  1. #1
    Join Date
    Dec 1969

    Default Tables in a CSV Database

    Is there ***ANY*** possible way that I can use the SQL command "UPDATE" to change a value in a CSV database?<BR><BR>I am using the following code to connect to the database:<BR><BR>&#060;%@ LANGUAGE="VBScript" %&#062;<BR>&#060;%<BR>Option Explicit<BR>Dim sScriptDir<BR>sScriptDir = Request.ServerVariables("SCRIPT_NAME")<BR>sScriptD ir = StrReverse(sScriptDir)<BR>sScriptDir = Mid(sScriptDir, InStr(1, sScriptDir, "/"))<BR>sScriptDir = StrReverse(sScriptDir)<BR>Dim sPath, sDSN<BR>sPath = Server.MapPath(sScriptDir) & "\"<BR>sDSN = "FileDSN=" & sPath & "csv.dsn" & ";DefaultDir=" & sPath & ";DBQ=" & sPath & ";"<BR><BR>Dim Conn, rs<BR>Set Conn = Server.CreateObject("ADODB.Connection")<BR>Conn.Op en sDSN<BR><BR>If Not Request.Form("choice") = "" Then<BR> Dim sql<BR> sql = "UPDATE poll.txt SET votes = (votes + 1) WHERE choice = &#039;" & Request.Form("choice") & "&#039;"<BR> Set rs = Conn.Execute(sql)<BR> rs.Close<BR> Set rs = Nothing<BR> Conn.close<BR> Set Conn = Nothing<BR>End If<BR>%&#062;<BR><BR>but it gives me an error message:<BR><BR>Microsoft OLE DB Provider for ODBC Drivers (0x80004005)<BR>[Microsoft][ODBC Text Driver] Updating data in a linked table is not supported by this ISAM.<BR>/smbpa/poll.asp, line 20<BR><BR>I am assuming it is because it is a simple CSV database, but if there is any way possible at all to add tables (or to even give the entire CSV file a pseudo-table name), please tell me ASAP.<BR><BR>Thank you,<BR>David Bindel

  2. #2
    Join Date
    Dec 1969

    Default RE: Tables in a CSV Database

    I know it is an important feature when purchasing a database to make sure it is SQL compliant. If by CSV, you mean Comma Separated Value, then I wouldn&#039;t think SQL would work with such a simple database. Your database must have an engine for interpreting SQL. You should probably import your CSV data into a SQL compliant database like Access, Oracle, SQL Server, or MY SQL. Then point your ASP to the SQL compliant data source you choose.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts