473,471 Members | 2,009 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

how to pass a database column value to a string

34 New Member
Expand|Select|Wrap|Line Numbers
  1. dim url,ojRS, SQL_Input
  2. set ojRS = Server.CreateObject("ADODB.Command")
  3. Set ojRS.ActiveConnection = C
  4. SQL_Input ="CP.dbo.usp_cs_Links"
  5. ojRS.CommandType = adCmdStoredProc
  6. set ojRS = C.Execute(SQL_Input,,adCmdText)
  7.  
  8.  
  9. url  = ojRS(LastKeyValue)
  10.  
  11.  Response.Write("<tr>")
  12.     Response.Write("<td Class=Field> ID:</td>")
  13.  
  14.         Response.Write("<td><A Class=TableLink HREF = 'http://"" url ""/cs/login.asp?SysKey="& SecEncode(iId) &" &srcserver=CP' >  " &SecEncode(iId) &"  </a> </td>")                  
  15.          Response.Write("</tr>")
  16.          objRS.close
  17.          Set ojRS = Nothing
  18.  
The problem with this is that it gives me an error with the hyper link
'http://"" url ""/cs/login.asp?SysKey="& SecEncode(iId) &" &srcserver=CP'

the url is actually the value of the from the database..the stored proc .
the output is the LastKeyValue from the stored proc .

there is an error
Can anyone please check the syntax.

thanks in advance
Nov 9 '07 #1
4 1477
sanika1507
34 New Member
url = ojRS(LastUsedKeyValue)

Response.Write("<td><A Class=TabLink HREF = 'http://"" url ""/csipts/login.asp?Key="& SecEncode(iId) &" &scserver=CP' > " &SecEncode(iId) &" </a> </td>")


HREF = 'http://"" url ""/csipts/login.asp?Key="& SecEncode(iId) &" &scserver=CP'

how to use the url here .can anyone help plzzzzzzzzzz

Thanks in advance
Nov 12 '07 #2
sonu5588
13 New Member
Madam u can take help me on Yahoo,
Mailme on <private message>
i will send u some files which helps u


Thanks In Advance
Nice laga
Nov 16 '07 #3
jhardman
3,406 Recognized Expert Specialist
Expand|Select|Wrap|Line Numbers
  1. url  = ojRS(LastUsedKeyValue) 
  2. %>
  3. <td><A Class="TabLink" HREF="http://<%=url%>/csipts/login.asp?Key=<%=SecEncode(iId)%>&scserver=CP">   <%=SecEncode(iId)%></a> </td>
  4. <%
  5.  
Nov 19 '07 #4
jhardman
3,406 Recognized Expert Specialist
Expand|Select|Wrap|Line Numbers
  1. dim url,ojRS, SQL_Input
  2. set ojRS = Server.CreateObject("ADODB.Command")
  3. Set ojRS.ActiveConnection = C
  4. SQL_Input ="CP.dbo.usp_cs_Links"
  5. ojRS.CommandType = adCmdStoredProc
  6. set ojRS = C.Execute(SQL_Input,,adCmdText)
  7.  
  8.  
  9. url  = ojRS(LastKeyValue) %>
  10. <tr>
  11.    <td Class="Field"> ID:</td>
  12.    <td><A Class="TableLink" HREF="http://<% =url %>/cs/login.asp?SysKey=<% =SecEncode(iId) %>&srcserver=CP"><% =SecEncode(iId) %></a> </td>
  13.     </tr>
  14.    <%
  15.          objRS.close
  16.          Set ojRS = Nothing
  17.  
The problem is that whenever you need to print large amounts of quote marks it is difficult to keep them straight. Of course it is up to you when to use response.write and when to leave the code delimiters, but I suggest that you leave the code delimiters entirely for this case since this block is so long. Does this make sense?

Jared
Nov 20 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Nelson Broat | last post by:
In jsp land you can have the following: <% String name = "Nelson"; %> Hi, my name is <%= name %>. Such that, in your browser you see:
3
by: Nath | last post by:
Please help!? I am new to writing html, javascript, pretty new to MySQL but quite proficient at writing Perl and i'm a quick learner. I am building a database driven website and i am a little...
2
by: Kums | last post by:
What is the maximum permissible size of a database? Is there any limitation. What is the maximum # of tablespace's allowed in a database? Thanks for your response.
7
by: Zlatko Matić | last post by:
Let's assume that we have a database on some SQL server (let it be MS SQL Server) and that we want to execute some parameterized query as a pass.through query. How can we pass parameters to the...
0
by: Zlatko Matić | last post by:
Hi everybody! Recently I was struggling with client/server issues in MS Access/PostgreSQL combination. Although Access is intuitive and easy to use desktop database solution, many problems...
6
by: Mike Hoff | last post by:
I am trying to write a class that will store info about database fields for building UPDATE / INSERT commands later on. I cannot seem to get the sytax correct to pass and store the data type of...
1
by: sara | last post by:
I am learning how to use simple functions to make my apps more powerful and efficient. On one screen, I want to populate field B: ItemDescription by looking up the ItemDescription in the Items...
4
by: onecorp | last post by:
I have a SQL table comprised of 31 columns. The first column is simply an id column, the next 30 columns are labelled ,.... The numerical columns have a tinyint type and the data stored is either...
12
by: ArunDhaJ | last post by:
Hi Friends, Is it possible to pass a table as a parameter to a funtion. whos function declaration would look some thing like this.... ALTER FUNCTION TempFunction (@TempTable TABLE, @nPId INT) ...
14
by: bill | last post by:
Can someone please show me an example of passing a string value into an sql statement in vb 2005? Something like this is what I'm after: Dim sqlButton1 As String = "Select * from tblAssets where...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.