Fetch from Database

Results 1 to 3 of 3

Thread: Fetch from Database

  1. #1
    Join Date
    Dec 1969

    Default Fetch from Database

    I have stored an .wav file in Database. The field type is image. Now I want to fetcg the content from DB and store it in .wav file. So I have used stream object. the code is like:<BR><BR>Set objStream = Server.CreateObject("ADODB.Stream")<BR>set obfso = server.createobject("Scripting.FilesystemObject")< BR>filnam = "c:play.wav"<BR>set file = obfso.CreateTextFile(filnam,True)<BR>obfso.close<B R>set obfso = nothing<BR>objStream.Type = adTypeBinary<BR>objStream.Open<BR>objStream.Write objRS("Wavfile")<BR>objStream.SaveToFile filnam<BR>objStream.Close<BR>Set objStream = Nothing<BR><BR>But it shows a error in the line objStream.SaveToFile reporting &#039;write to file failed&#039;<BR>Why such an error I am getting?<BR>

  2. #2
    Join Date
    Dec 1969

    Default RE: Fetch from Database

    Permissions?<BR><BR>I dunno - what other information do you get in the error? How about posting the ENTIRE of the EXACT error, including the description, error code, etc.<BR><BR>Craig.

  3. #3
    Join Date
    Dec 1969

    Default wrong approach !

    hey...<BR><BR>Why dont you store your .WAV on the FileSystem under a dir onmt he web server. in your database, store the URL/PATH of where the .WAV file sits on your web server. Then, you read the path to the file from the DB, and present that in an &#060;a&#062;nchor link in your web browser, for the user to save by clicking. THis way, your database is more efficient and your application/code involved far more simpler and efficient.

Posting Permissions

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