inserting into a row

Results 1 to 7 of 7

Thread: inserting into a row

  1. #1
    emy Guest

    Default inserting into a row

    I have a row with 4 headings, Name, Age, Height, Weight. I already have a name and age recorded in the row while there is no height nor weight. Is there a way I can insert values into the empty fields? This is what I&#039;ve tried:<BR><BR>sql = "select * from test.csv where ID like &#039;" &u_name &"&#039;" <BR>set rs = conn.execute(sql)<BR><BR>sql = "insert into test.csv (Height) "<BR>sql = SQL & "values (&#039;" & u_height & "&#039;)" <BR>set rs = conn.execute(sql)<BR><BR>What happens is that the value (height) is inserted into a new row instead of the column I selected. Any ideas?

  2. #2
    Hi-Tek Redneck Guest

    Default suggestion

    Well<BR><BR>IMO, you need to learn some basic sql before getting to carried away with the glamour of asp.<BR><BR>you want do this<BR>update tablename SET height = "& height &" where id = "& id &"<BR><BR>I don&#039;t mind the simple question, but you have to understand this is extremely simple. (in comparison, its like learning 1+1 = 2)

  3. #3
    emy Guest

    Default not as easy as you thought....

    I know this is a simple problem, and yes, I have used the UPDATE function. When I use UPDATE, i get the following error:<BR><BR>Microsoft OLE DB Provider for ODBC Drivers error &#039;80004005&#039; <BR><BR>[Microsoft][ODBC Text Driver] Updating data in a linked table is not supported by this ISAM. <BR><BR>I would be very grateful if you could help me with this.

  4. #4
    Heaven's Martini Guest

    Default it is...

    Well,<BR><BR>a Text Driver? never seen that before.<BR><BR>Lets see your connection string and what kinda db are you using?<BR><BR>you haven&#039;t told me the whole story evidently.

  5. #5
    emy Guest

    Default here you go

    Sorry for not filling you in, I&#039;m actually using a csv. Here&#039;s the code you wanted, and more. I hope it helps.....<BR><BR>Dim sDSNFile<BR> sDSNFile = "CSV.dsn"<BR><BR> Dim sScriptDir<BR> sScriptDir = Request.ServerVariables("SCRIPT_NAME")<BR> sScriptDir = StrReverse(sScriptDir)<BR> sScriptDir = Mid(sScriptDir, InStr(1, sScriptDir, "/"))<BR> sScriptDir = StrReverse(sScriptDir)<BR><BR> Dim sPath, sDSN<BR> sPath = Server.MapPath(sScriptDir) & "\"<BR> sDSN = "FileDSN=" & sPath & sDSNFile & _<BR> ";DefaultDir=" & sPath & _<BR> ";DBQ=" & sPath & ";"<BR> <BR> Dim Conn, rs<BR> Set Conn = Server.CreateObject("ADODB.Connection")<BR> Conn.Open sDSN<BR> <BR> Dim sql<BR><BR>the code I previously typed out would go here.

  6. #6
    Heaven's Martini Guest

    Default My Apologies, Anyone else?

    sorry,<BR><BR>I have never, ever done anything with a csv like that,<BR><BR>I did learn what ISAM is. <BR>Sorry, I am a database guy, I use CSV&#039;s but I use DTS <BR>to take care of them, or FSO. <BR><BR>This is out of my bailiwick, good luck

  7. #7
    Join Date
    Dec 1969

    Default Probably not possible...

    ...which is what I think the message is telling you.<BR><BR>Think about it a second: First, see this ASPFAQ:<BR><BR>Then consider what that means: The MS ODBC Text Drive has to follow the same rules. So when you ask it to change the value of a field, it has to read the ENTIRE file into memory, change the field, and then write the ENTIRE file back out to disk. I doubt seriously that it was designed to do that.<BR><BR>Why are you using a .csv file, in the first place?<BR><BR>It would be *SO* much more efficient to use an Access DB.<BR>

Posting Permissions

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