|
Hi all,
i am trying to save images that are saved in a image field sql field. i am trying to do it whith :
'selecciono los datos de la imagen
cad="guarda_imagen '" & idproducto & "'"
cad="select * from imagenes inner join imagen_file on imagenes.idimagen=imagen_file.idimagen where pcode='6022SD'"
set result=cnximagen.Execute(cad,,adcmdtext)
nombre=result("filename")
set mstream=server.CreateObject("ADODB.Stream")
'Set mstream =new ADODB.Stream
mstream.Type =adTypeBinary
mstream.Open
mstream.Write result.fields("imagen")
mstream.SaveToFile "d:\Espots\" & result"filename"),adSaveCreateNotExist
but it stop in mstream.type=adtypebinary , the error said "argument in conflict whith others"
anyone know how fix it or how could i do it?
thanks
|
|
|
|
|
Howdey
Now you can look at my code but before you do that there is only two things that you must check.
(1) Do you have MDAC 2.5 or later installed (I think the Stream object is in any case only included in version 2.5 and later ...)
(2) I'm not using late binding - you are.
Other than that I don't know why you would get that error message.
Good luck anyways!
Below is my code:
Dim Rst As New ADODB.Recordset
Dim adoCon As New ADODB.Connection
Public Sub TEST_OPEN()
adoCon.ConnectionString = "PROVIDER=SQLOLEDB;DATA SOURCE=IANLAP;DATABASE=MYDB;USER ID=developer;PASSWORD=developer;"
adoCon.Open
'
Dim s As String
'
s = "Select [id],[data] From [tblImage] Where [id]=1"
Set Rst.ActiveConnection = adoCon
Rst.LockType = adLockOptimistic
Rst.CursorType = adOpenKeyset
Rst.Open s
'
Dim mStream As New ADODB.Stream
'
If Dir("C:\temppicture.bmp") <> "" Then Kill "C:\temppicture.bmp"
'
With mStream
.Type = adTypeBinary
.Open
.Write Rst("data")
.SaveToFile "C:\temppicture.bmp"
.Close
End With
Set mStream = Nothing
'
Rst.Close
Set Rst = Nothing
End Sub
Ian
|
|
|
|
|
I want to connect to MS ACCESS and rerieve records in a table using PHP. How can I achieve this?
samitha
|
|
|
|
|
I've never had a need for this personally; however, here is an example I found on the PHP site as a user contributed comment (http://ca.php.net/manual/en/ref.com.php):
$conn = new COM("ADODB.Connection");
$dsn = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" . realpath("mydb.mdb");
$conn->Open($dsn);
Also check pear.php.net I know they have an absraction layer class that will do the trick. Remember that you need COM installed with PHP
|
|
|
|
|
When I use the "Build Comment Web Pages" on the Tools Menu of VS.NET 2003, the following type of HTML comment is generated at the top of every HTM file
""
I have recently installed Service Pack 2 of Windows XP. Now when the above comment is detetected by IE6, the Internet Zone is considered to be "Restricted" instead of Local Machine.
I have tried changing the security level for Restricted sites with the Internet Options of the Control Panel. This generated an error and the setting remained high. The ideal would be for the comments to be ignored so that the site would be considered local (I didn't get any help from the c# side about retarding the comments). There are too many pages to delete them all.
HOW CAN I GET AROUND THIS?
|
|
|
|
|
|
Hi guys.
I have created a XML Web Service called BugTraker and I have the usernames, passwords and roles stored into SQL server tables called tUsers and tRoles.
How can I configure my web server to authenticate users, passwords and roles from SQL Server?
If somebody has some examples I'll appreciate.
Thanks
Ali Hidalgo
|
|
|
|
|
Hi,
We can use three types of authentication with webservices. This can be achieved by setting the authentication mode in Web.config.
<authentication mode="Forms">
When we set the authentication mode to forms we can perform our custom authentication.
Set the authentication mode to forms and validate the users aganist the list of users avaliable in the data base.
Thanks
|
|
|
|
|
Hi all
can anyone tell....
how to disappear save as menu from browser
thanks in advanced
ashu
|
|
|
|
|
1) Sneak into Microsoft offices
2) Hack into MS source control system
3) Alter code for IE browser
4) Go home, and reap the rewards
(all of which is my obnoxious way of saying that it cannot be done).
my blog
|
|
|
|
|
I'm looking for ideas on how to handle managing a database of images for a website. Basically, users will be able to post pictures in multiple formats for a variety of reasons. I assume I will assign an id to each image and probably rename the file to that id. For increased speed, I've heard the best thing to do is store the files in multiple directories in the filesystem, such as directories 1-9 and sort the files into their directories based on id. Then in the database I would store the id, timestamp, user that submitted the pic, id of what part of the site it belongs to, and maybe a text description. What would be the best way to generate these ids, prevent collisions, etc.
I feel like I'm on the right track, but I'd like to hear from anyone who has done something like this before or anyone else that has some ideas.
Thanks.
|
|
|
|
|
I would follow the KISS principle, i.e. keep it simple. If you plan on having thousands of images, then by all means you should work out some directory structure that makes efficient use of system IO capabilities. Otherwise, why bother.
As for Ids, I have found GUIDs to be good. They:
* are unique
* can be combined with a file name, e.g. {FFE3-...-A1}StevesPhoto.jpg, to allow human-readable directories.
* can be used to split into folders, e.g. create an FF folder for those Guids that start with FF.
Guids can be generated by the database, or by code.
my blog
|
|
|
|
|
I have an ASP application that was hosted on an webserver (Intranet) that is used for many other applications. So, that server is maintained by some administrators. I'm an administrator on that server. I don't want them being able to view my application's source code.
I've heart that there is way to protect ASP application using encoding method. The question is how to do that. Could you please help me on this matter.
Thanks in advance.
|
|
|
|
|
Perhaps you could use NTFS permissions to lock everyone but the ASP process from viewing the files. Otherwise, you could try a tool like Stunnix Obfuscator.
my blog
|
|
|
|
|
Apologies if this has already been covered but I am keen to get this implemented.
We have several sites that send email on behalf of visitors including but not limited to 'email a friend' type services. I am trying to ensure that all our websites comply with the guidelines of SPF (Sender Policy Framework) when it comes to web generated emails (http://spf.pobox.com/webgenerated.html). I am unsure though how this can be implemented within a CDO generated email. Does anyone now how to change the return-path or reply-to settings within a cdo.configuration object or otherwise?
I am currently left approaching it in the same way as (http://www.gossamer-threads.com/lists/spf/srs/8766) where I set the from address to the third party and the sender address as info@ourdomain.com. This seems to work but may not be good enough for SPF compliance.
Any ideas?
Thanks in advance
Adam
|
|
|
|
|
Ok, I've worked it out myself reading loads of incorrect information all over the place!
Finally coming up with this, which is of course very simple and probably obvious to some -
Set objMail = Server.CreateObject("CDO.Message")
with objMail
.To = "foo@bar.com"
.From = "name@3rdparty.com"
.Fields("urn:schemas:mailheader:return-path").Value = "info@ourdomain.com"
.Fields.Update()
.Sender = "info@ourdomain.com"
.HTMLBody = strMailBody
.Subject = strSubject
.Send
end with
Set objMail = Nothing
Tried for ages using a cdo configuration object, but you don't actually need one.
This sets both sender and return-path to an SPF valid address and the from to the person sending the email a friend (or whatever).
I hope this is of some use to others.
Cheers
Adam
|
|
|
|
|
Why might be the reason that IIS is running aspx files perfectly, but not asp ones? Any file I write using .NET runs fine, anything that was created with VS6.0 or just a plain text will not load. I'm getting a HTTP 500 Internal Server Error message. Any ideas?
Thanks
|
|
|
|
|
Hi there. One thing I would check is to see if the asp.dll extension is mapped on your site. Go to Administrative Tools -> Internet Information Services Manager, right click the web site and choose "Properties". Then click the "Home Directory" tab and click the "Configuration" button. From the Application Configuration window, look on the "App Mappings" tab and see if ".asp" is mapped to a dll like "C:\WINNT\System32\inetsrv\asp.dll".
If that's not it, you may want to check out this document: http://www.aspfaq.com/show.asp?id=2109[^]
|
|
|
|
|
Your advice was pretty good, unfortunately it didn't help one bit. My boss and I have spent the majority of today toying with as many IIS settings as we possibly could in hopes of making this work again, to no avail I'm hoping to avoid rebuilding this machine, because that's the point where we are at. Thanks for the help!
|
|
|
|
|
Mmmm. If I add a "BlogThis!" button to my IE links toolbar, it won't work - perhaps because I have upgraded to SP2. The button uses the following URL:
javascript:popw='';Q='';x=document;y=window;if(x.selection) {Q=x.selection.createRange().text;} else if (y.getSelection) {Q=y.getSelection();} else if (x.getSelection) {Q=x.getSelection();}popw = y.open('http://www.blogger.com/blog_this.pyra?t=' + escape(Q) + '&u=' + escape(location.href) + '&n=' + escape(document.title),'bloggerForm','scrollbars=no,width=475,height=300,top=175,left=75,status=yes,resizable=yes');if (!document.all) T = setTimeout('popw.focus()',50);void(0);
OK, I know I can install the Google Toolbar for a "BlogThis!" button, but I am intrigued as to why the above doesn't work.
Anyone have any clues?
"May the seed of your loin be fruitful in the belly of your woman"
|
|
|
|
|
I am having a specific problem , our application is a local intranet application, we have different types of printouts printing from our application.
I want to send if pint type is "A" send the output to Printer "Epson Dot matrix Pritner" . If output type is B send the output to Printer "Laser Pritner" . I want to do all this from my webpage.
Can you tell how to control the printer from the webpage. Or send output to particular printer.
Otherwise please help me how to execute Local .VBS file from a webpage. In which case i can write .vbs file that will receive a parameter and based on the parameter i can set the printer locally.
I hope your guys understood my problem.
|
|
|
|
|
Try
<br />
<IMG SRC="Images/AddNew.gif" BORDER="0" ALIGN="middle">New<br />
--G
|
|
|
|
|
|
I can not figure out how to align the text to the middle of a image. Here is what I have in the same cell inside an Anchor but the text sits at the bottom of the cell even when I set the cell valign to middle.
<IMG src="Images/AddNew.gif" border="0">New
How do i get these to valign in the middle?
Thanks
|
|
|
|
|
Is there a way to either/or change the blink rate for the I-Bar or change the cursor to a block cursor.
|
|
|
|