www.webdeveloper.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 16

Thread: Interbase problem export stored image

  1. #1
    Join Date
    Jul 2003
    Posts
    184

    Interbase problem export stored image

    Hi,

    I know anything about Interbase. My client run it at their office and I need to export some info to convert and then put into MySQL server. It's all ok for textual information (export to csv) but i've got some problem to grab the stored image from the Database.

    My client used Run-It as the front-end of the DB and the support told me to create jpeg from binary data using ODBC.

    I really need some help about that. Can someone have any idea ???

  2. #2
    Join Date
    Dec 2004
    Posts
    8,637
    Sounds like you want the ADODB.Stream object. I use the following code to receive a binary file upload from the client and write it to a file on the server:
    Code:
    Dim adoStream, stream
    Set adoStream = Server.CreateObject("ADODB.Stream")
    adoStream.Open()
    adoStream.Type = adTypeBinary
    stream = mpRequestFiles(fld, 1)
    adoStream.Write stream
    adoStream.SaveToFile Server.MapPath("/uploads/" & fileName), adSaveCreateOverWrite
    adoStream.Close()
    Set adoStream = Nothing
    Perhaps you can get this code to work for you.

  3. #3
    Join Date
    Jul 2003
    Posts
    184
    thank phpnovice!

    so if I run that asp script, it'll create jpeg ... sound great to me but can you guide me thru the script cause I'm not good at asp

    turb

  4. #4
    Join Date
    Jul 2003
    Posts
    184
    and can I run this script in a loop cause i have about 10000 images into the db ??

  5. #5
    Join Date
    Dec 2004
    Posts
    8,637
    Yes, you can run it in a loop:
    Code:
    Set adoStream = Server.CreateObject("ADODB.Stream")
    adoStream.Type = adTypeBinary
    While Not rs.EOF
        adoStream.Open()
        adoStream.Write fldName ' your binary database field here
        adoStream.SaveToFile Server.MapPath(PathAndFileName), adSaveCreateOverWrite
        adoStream.Close()
    '
        rs.MoveNext
    Loop
    Set adoStream = Nothing

  6. #6
    Join Date
    Jul 2003
    Posts
    184
    Hi phpnovice,

    thank alot for your help. I've got a problem connecting to Interbase. I've install the driver but always got error message :

    Set MyConn = Server.CreateObject("ADODB.Connection")
    MyConn.Open("Provider=MSDASQL;Pwd=masterkey;UID=sysdba;Dsn=vasco") (line 6)
    Rs = MyConn.Execute("SELECT * FROM JOB")


    and here's my error msg:

    Error Type:
    Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
    [Easysoft][InterBase]unavailable database
    /vasco/test.asp, line 6

    can you help me ?

  7. #7
    Join Date
    Dec 2004
    Posts
    8,637
    Your connection string specifies a DSN ("vasco") that evidently has the database path and file name coded as "/vasco/test.asp" -- which would not be correct in my book. I'd say that you need to fix your DSN.

  8. #8
    Join Date
    Jul 2003
    Posts
    184
    Hi ... thank for your patience!

    I use Easysoft driver. I've create an ODBC dns connection and when I click on the button TEST, it said "connect test successfully"

    I don't really understand your last answer (i'm a french guy) ... can you be more specific please

    turb

  9. #9
    Join Date
    Dec 2004
    Posts
    8,637
    Originally posted by turb
    I use Easysoft driver. I've create an ODBC dns connection and when I click on the button TEST, it said "connect test successfully"
    Yes, but where is that DNS defined? Is it defined on the same computer where your ASP code executes?

  10. #10
    Join Date
    Jul 2003
    Posts
    184
    yes ... the interbase is installed on my computer

  11. #11
    Join Date
    Dec 2004
    Posts
    8,637
    Well, that is not quite the whole question. Where does the server software execute? By the way... Which server software (IIS, Apache, etc.) are you using?

  12. #12
    Join Date
    Jul 2003
    Posts
    184
    IIS on windows XP

    many thank to you for your time ...

  13. #13
    Join Date
    Jul 2003
    Posts
    184
    the server software i've installed is Interbase 7.5 trial ... installed on my c:/

    The only thing I've done right now is :

    -Installed the Interbase software
    -Installed the EasySoft ODBC driver
    -Create the DNS connection

    I try to find info and tutorial on the web but i don't really find what I need!

  14. #14
    Join Date
    Dec 2004
    Posts
    8,637
    Yes, I'm not familiar with Interbase either. Sorry. A question though... Did the Interbase documentation tell you to use the following specification in your connection string?

    Provider=MSDASQL;

    I ask, because I believe this is a MicroSoft interface to SQL Server databases. Otherwise, try changing your connection string to this:

    "Dsn=vasco;UID=sysdba;Pwd=masterkey;"

  15. #15
    Join Date
    Jul 2003
    Posts
    184
    I've follow this tutorial for the connection :

    http://community.borland.com/article...,27152,00.html

    I'll try your connection type ...

    thank

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles