View Single Post
  #2 (permalink)  
Old Jan 28th, 2008, 01:06
Monie Monie is online now
Most Reputable Member
Join Date: Feb 2004
Location: Borneo
Age: 27
Posts: 1,608
Blog Entries: 2
Thanks: 0
Thanked 4 Times in 3 Posts
Send a message via Yahoo to Monie
Re: Get value from SQL string ?

You are right about "DLookup is not used in VBScript/ASP"!
But there is a VBScript Function that you could use, It imitates the functionality of the MS Access function of the same name which is like the one that you are using ^

Code: Select all
strvalue = dlookup("PicInsert") FROM tblCon WHERE "Name" = Request.Form("contributor")
I am not sure that you use the correct syntax for your code above ^ but from what I understand when I see your code is that you are trying to retrieve the PicInsert field from the tblCon table where the Name is from your contributor input field. This is the same as the following SQL statement in more organize and fast way:

HTML: Select all
<%
   Dim strvalue, name
   name = Request.Form("contributor")
   strvalue  = ("SELECT PicInsrt FROM tblConn WHERE Name= '"& name &"'")
%>
Note: when retrieving a string value, you must put ' around them. " is for numbers. Assign any value that you would like to search into a variable for fast script execution (Like what I have done with your Request.Form)

Last edited by Monie; Jan 28th, 2008 at 01:08.
Reply With Quote