adding a large file to a database....

adding a large file to a database....

am 24.01.2005 17:30:38 von Mark Mchugh

hi all,
I am trying to add a large file to my database, and it
does not seem to work?
i am using the following code


Dim mystream As ADODB.Stream
Set mystream = New ADODB.Stream
mystream.Type = adTypeBinary
Set rs = New ADODB.Recordset
rs.ActiveConnection = connMySQL
rs.Open sqlstr, connMySQL, adOpenStatic,
adLockOptimistic

rs.AddNew
mystream.Open
mystream.LoadFromFile strFileName


rs!file_name = CatDir

rs!file_size = mystream.Size
rs!File = mystream.Read

rs.Update
mystream.Close
rs.Close


when i try to add a file that is ( dont laugh) 1.5
megs or over, i get a message saying " lost connection
to mysql server during query"

can anybody help?


thanks



__________________________________
Do you Yahoo!?
Take Yahoo! Mail with you! Get it on your mobile phone.
http://mobile.yahoo.com/maildemo

--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org

Re: adding a large file to a database....

am 24.01.2005 17:32:45 von Mike Hillyer

Mark;

Sounds like you did not set MAX_ALLOWED_PACKET on the server to
something higher than 1.5M.

Mike


Mark Mchugh wrote:
> hi all,
> I am trying to add a large file to my database, and it
> does not seem to work?
> i am using the following code
>
>
> Dim mystream As ADODB.Stream
> Set mystream = New ADODB.Stream
> mystream.Type = adTypeBinary
> Set rs = New ADODB.Recordset
> rs.ActiveConnection = connMySQL
> rs.Open sqlstr, connMySQL, adOpenStatic,
> adLockOptimistic
>
> rs.AddNew
> mystream.Open
> mystream.LoadFromFile strFileName
>
>
> rs!file_name = CatDir
>
> rs!file_size = mystream.Size
> rs!File = mystream.Read
>
> rs.Update
> mystream.Close
> rs.Close
>
>
> when i try to add a file that is ( dont laugh) 1.5
> megs or over, i get a message saying " lost connection
> to mysql server during query"
>
> can anybody help?
>
>
> thanks
>
>
>
> __________________________________
> Do you Yahoo!?
> Take Yahoo! Mail with you! Get it on your mobile phone.
> http://mobile.yahoo.com/maildemo
>

--
Mike Hillyer, Technical Writer
MySQL AB, www.mysql.com
Office: +1 403-380-6535
Mobile: +1 403-330-0870

MySQL User Conference (Santa Clara CA, 18-21 April 2005)
Early registration until February 28: www.mysqluc.com

--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org

Re: adding a large file to a database....

am 24.01.2005 17:34:49 von Dijital

How long does it take before the error happens? Remember that IIS has a
default script timeout, which i believe is 90 seconds. Any query that
takes longer than that will fail. Cheers.

Armando

Mark Mchugh wrote:
> hi all,
> I am trying to add a large file to my database, and it
> does not seem to work?
> i am using the following code
>
>
> Dim mystream As ADODB.Stream
> Set mystream = New ADODB.Stream
> mystream.Type = adTypeBinary
> Set rs = New ADODB.Recordset
> rs.ActiveConnection = connMySQL
> rs.Open sqlstr, connMySQL, adOpenStatic,
> adLockOptimistic
>
> rs.AddNew
> mystream.Open
> mystream.LoadFromFile strFileName
>
>
> rs!file_name = CatDir
>
> rs!file_size = mystream.Size
> rs!File = mystream.Read
>
> rs.Update
> mystream.Close
> rs.Close
>
>
> when i try to add a file that is ( dont laugh) 1.5
> megs or over, i get a message saying " lost connection
> to mysql server during query"
>
> can anybody help?
>
>
> thanks
>
>
>
> __________________________________
> Do you Yahoo!?
> Take Yahoo! Mail with you! Get it on your mobile phone.
> http://mobile.yahoo.com/maildemo
>

--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org

Re: adding a large file to a database....

am 24.01.2005 17:48:05 von John

Hello Mark;

At Mon, 24 Jan 2005 08:30:38 -0800 (PST),
Mark Mchugh wrote:
>
> hi all,
> I am trying to add a large file to my database, and it
> does not seem to work?
> i am using the following code
>
>
> Dim mystream As ADODB.Stream
> Set mystream = New ADODB.Stream
> mystream.Type = adTypeBinary
> Set rs = New ADODB.Recordset
> rs.ActiveConnection = connMySQL
> rs.Open sqlstr, connMySQL, adOpenStatic,
> adLockOptimistic

it may not be your exact problem, but it's generally a smart idea to check
Open statements for returned error codes, that makes it much easier to
diagnose trouble when things go wrong....

> rs.AddNew
> mystream.Open
> mystream.LoadFromFile strFileName

all of these also could stand some error chacking...

>
> rs!file_name = CatDir
>
> rs!file_size = mystream.Size
> rs!File = mystream.Read
>
> rs.Update
> mystream.Close
> rs.Close
>
>
> when i try to add a file that is ( dont laugh) 1.5
> megs or over, i get a message saying " lost connection
> to mysql server during query"
>
> can anybody help?
>
>
> thanks
>
>
>
> __________________________________
> Do you Yahoo!?
> Take Yahoo! Mail with you! Get it on your mobile phone.
> http://mobile.yahoo.com/maildemo
>
> --
> MySQL Windows Mailing List
> For list archives: http://lists.mysql.com/win32
> To unsubscribe: http://lists.mysql.com/win32?unsub=john@utzweb.net
>
>

--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org

Re: adding a large file to a database....

am 24.01.2005 17:55:45 von Mark Mchugh

thanks Mike, as correct as ever!!!



--- Mike Hillyer wrote:

> Mark;
>
> Sounds like you did not set MAX_ALLOWED_PACKET on
> the server to
> something higher than 1.5M.
>
> Mike
>
>
> Mark Mchugh wrote:
> > hi all,
> > I am trying to add a large file to my database,
> and it
> > does not seem to work?
> > i am using the following code
> >
> >
> > Dim mystream As ADODB.Stream
> > Set mystream = New ADODB.Stream
> > mystream.Type = adTypeBinary
> > Set rs = New ADODB.Recordset
> > rs.ActiveConnection = connMySQL
> > rs.Open sqlstr, connMySQL, adOpenStatic,
> > adLockOptimistic
> >
> > rs.AddNew
> > mystream.Open
> > mystream.LoadFromFile strFileName
> >
> >
> > rs!file_name = CatDir
> >
> > rs!file_size = mystream.Size
> > rs!File = mystream.Read
> >
> > rs.Update
> > mystream.Close
> > rs.Close
> >
> >
> > when i try to add a file that is ( dont laugh) 1.5
> > megs or over, i get a message saying " lost
> connection
> > to mysql server during query"
> >
> > can anybody help?
> >
> >
> > thanks
> >
> >
> >
> > __________________________________
> > Do you Yahoo!?
> > Take Yahoo! Mail with you! Get it on your mobile
> phone.
> > http://mobile.yahoo.com/maildemo
> >
>
> --
> Mike Hillyer, Technical Writer
> MySQL AB, www.mysql.com
> Office: +1 403-380-6535
> Mobile: +1 403-330-0870
>
> MySQL User Conference (Santa Clara CA, 18-21 April
> 2005)
> Early registration until February 28:
> www.mysqluc.com
>
> --
> MySQL Windows Mailing List
> For list archives: http://lists.mysql.com/win32
> To unsubscribe:
>
http://lists.mysql.com/win32?unsub=mark_mch@yahoo.com
>
>




__________________________________
Do you Yahoo!?
Yahoo! Mail - Easier than ever with enhanced search. Learn more.
http://info.mail.yahoo.com/mail_250

--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@m.gmane.org