 |
| Recent blog posts: | |
 |
| They have birthday today: | |
 |
| Forums: | | |
 |
| Discuss: | |
 |
| Recent forum topics: | |
 |
| Recent forum comments: | |
 |
| Модератор: | |
 |
Friday, 8 August 2008
|
| Problem with query LIKE and Access Paolo Galli 17:39:58 |
| | Hi all I have a problem with an ASP page and an Access query
The following query works fine into Access 2007
SELECT tbl_gallery.id, tbl_gallery.nome, tbl_gallery.luogo, tbl_gallery.provincia, tbl_gallery.data, tbl_gallery.descrizione, tbl_gallery.esposizione, tbl_gallery.diorama, tbl_gallery.privato, tbl_gallery.cap, tbl_gallery.telefono, tbl_gallery.online FROM tbl_gallery WHERE (((tbl_gallery.nome) Like [?] & "*") AND ((tbl_gallery.diorama)=No) AND ((tbl_gallery.online)=Yes)) ORDER BY tbl_gallery.nome;
it extract all the name starting with the letter I specify
anyway when I call the query into an ASP page I get no records shown here a snippet...
Set rs_pres_amici = Server.CreateObject("ADODB.Recordset")
rs_pres_amici.cursorlocation = 3 con_pres_amici.q_gallery chiave, rs_pres_amici
totalRecs = rs_pres_amici.RecordCount
quanti = 20
pag = Request.QueryString("pag") If IsNumeric(pag) = False Or pag < 1 Then pag = 1
contatore = 0 If rs_pres_amici.EOF then
I always get NO RECORDS FOUND
where is my error ?
thanks Paolo
|
| | 5 answers | Add comment |
|
| Combo box on ASP page Paulmitchell507 17:22:27 |
| | I am not sure if this should be posted in a Java forum, bit it does concern asp. I have the following script on my asp (classic) page.
<html> <head> <title>Example combo box</title>
<script language="javascript"> <!--
function dept_onchange(frmSelect) { frmSelect.submit(); }
//--> </script> </head> <body> <form name="frmSelect" method="Post" action="select.asp"> <SELECT name=courses LANGUAGE=javascript onchange="return dept_onchange(frmSelect)"> <% Set oRs=Server.CreateObject("adodb.recordset") strSQL = "SELECT Status_ID, Staff_ID, firstlastName FROM staff WHERE Status_ID=1 Or Status_ID=19 ORDER by firstlastname" oRs.Open strSQL, conn
Do while not oRs.EOF if Request.Form("courses") = oRs("firstlastName") then 'if this is the selected one then display as selected Response.Write "<OPTION VALUE = '" & oRS ("staff_ID") & "' SELECTED>" Response.Write oRs("firstlastName") & "</Option>" oRs.MoveNext else Response.Write "<OPTION VALUE = '" & oRs ("Staff_ID") & "'>" Response.Write oRs("firstlastName") & "</Option>" oRs.MoveNext end if loop The script works fine, it lists the firstlastname field from the access 2k database and places the corrasponding staff_ID value in Request.Form("courses"). What I would like to do is display the selected firstlastname value in box further down the page. I would appreciate it if anybody could help with, what looks like, a simple task.
|
| | 2 answer | Add comment |
|
| Detecting if modified since in Classic Asp Simon 15:13:52 |
| | Hi
I am trying to read the html header 'if modified since' by using Request.ServerVariables("HTTP_IF_MODIFIED_SINCE") in classic ASP. But I am unable to get anything from this, this variable is always empty. It is also excluded when I try to list all the server variables. We are using IIS6.
So please can someone confirm what is the correct syntax?
Cheers,
Simon.
|
| | 15 answers | Add comment |
|
| General forms Paulo 03:24:49 |
| | I have to do some basic asp pages with the same basic features like insert, delete, select and update. What changes is just the tables and columns on DataBase....
What do you suggest me to optimize it? Do you know something?
or should I keep writing one by one?
Many thanks!
|
| | 1 answer | Add comment |
|
| INSERT Data from SELECT query Paulmitchell507 01:02:37 |
| | I think I am attempting a simple procedure but I just can't figure out the correct syntax. My asp (classic) page runs a SELECT query to obtain dates and ID's from 2 tables
uSQL = "SELECT cal_date, holiday_ID from Calendar, holiday_tbl WHERE (((calendar.cal_Date) Between [holiday_tbl].[startdate] And [holiday_tbl].[enddate])) And Email_sent=0 AND Staff_ID=" & Staff_ID
This works fine.
What I would like to do next is insert the returned values (cal_date) and (holiday_ID) into a seperate table called holiday_dates. I am happy to insert the results one recordset at a time, but I don't know how to do it. I know that uSQL is returning results
'Loop until we've hit the EOF Do Until objRS.EOF = True response.write objRS("holiday_ID") & " " & objRS("cal_date") & " " objRS.movenext Loop
I would appreciate any help
|
| | 2 answer | Add comment |
Thursday, 7 August 2008
|
| Variable in call to #include Ron Hinds 22:47:45 |
| | I want to know if this statement would be legal (and produce the desired result, i.e., pass a variable to the include file):
<!-- #include file="/scripts/include.asp?id=<%=ID%>" -->
Thanks!
|
| | 2 answer | Add comment |
|
| Setting value of input from SQL database to edit Epoh Rio 22:36:00 |
| | Hi, I am trying to create a way to edit data in a database.
Response.Write ("<input name=""issue"" value=" & recSet.Fields("Name") & """
</td></tr>") If the name contains a space (i.e. first and last name)
It only displays the first name (because of the space)
I have tried several things to get this to work
Works: Response.Write (recSet.Fields("Name"))
But I can't (even if I store the data as a variable) get it to display the full name.
Any ideas????
Thanks,
|
| | 1 answer | Add comment |
|
| How do you know what this group is about? Phpbaby3 21:38:08 |
| | Is inetserver a term whose meaning you know and it is of interest?
How did you learn about the existance of this group?
Thanks!
|
| | Add comment |
|
| ASP/Java Paulmitchell507 18:40:54 |
| | I am not sure if this should be posted in a Java newsgroup or not, I am sure I will be told where it should be! I have a small asp(classic) app that runs the following java script to display a drop down list containing usernames from a access 2k database.
<html> <head> <title>Example combo box</title>
<script language="javascript"> <!--
function dept_onchange(frmSelect) { frmSelect.submit(); }
//--> </script> </head> <body> <form name="frmSelect" method="Post" action="select.asp"> <SELECT name=courses LANGUAGE=javascript onchange="return dept_onchange(frmSelect)"> <% Set oRs=Server.CreateObject("adodb.recordset") strSQL = "SELECT Status_ID, Staff_ID, firstlastName FROM staff WHERE Status_ID=1 Or Status_ID=19 ORDER by firstlastname" oRs.Open strSQL, conn
Do while not oRs.EOF if Request.Form("courses") = oRs("firstlastName") then 'if this is the selected one then display as selected Response.Write "<OPTION VALUE = '" & oRS ("staff_ID") & "' SELECTED>" Response.Write oRs("firstlastName") & "</Option>" oRs.MoveNext else Response.Write "<OPTION VALUE = '" & oRs ("Staff_ID") & "'>" Response.Write oRs("firstlastName") & "</Option>" oRs.MoveNext end if loop
This works, to the point where it puts the value of staff_ID into request.form("courses"). What I would like to do is store the "Group_ID" values also. Please could somebody provide the code to store the additional value. I then post the 2 values to a another asp page for insertion into another table in the database.
Regards.
|
| | 2 answer | Add comment |
|
| How to free (file) resources after closing the browser Sebastian Fr nk 16:57:29 |
| | How can I free all file resource without waiting for the garbage collector to cleanup?
Visual Studio 2008 Visual Studio Development Server Vista 64-bit
|
| | 2 answer | Add comment |
|
| Operation is not allowed when the object is closed. Isaac2004 14:14:35 |
| | hi i am trying to use the record count object to count the number of books in a database of mine. i get this error saying that i have closed the object and i dont think i closed it. here is my code
<% dim strBrowse, strSearch, Count
Count = objRS.RecordCount
strBrowse = request.querystring("strBrowse") strSearch = request.querystring("strSearch")
if strBrowse > "" then strSQL = "SELECT distinctrow tblCategories.strCategory, tblBookDescription.ISBN, tblBookDescription.strTitle, tblBookDescription.strDescription " & _ "FROM tblBookDescription INNER JOIN tblCategories ON tblBookDescription.ISBN = tblCategories.ISBN " & _ "Where (((tblCategories.strCategory) = '" & strBrowse & "')) " & _ "ORDER BY tblBookDescription.strTitle "
End If if strSearch > "" then strSQL= "SELECT distinctrow tblBookDescription.strTitle, tblBookDescription.strDescription, tblBookDescription.ISBN " & _ "FROM tblAuthors INNER JOIN (tblBookDescription INNER JOIN tblAuthorsBooks ON tblBookDescription.ISBN = tblAuthorsBooks.ISBN) ON tblAuthors.AuthorID = tblAuthorsBooks.AuthorID "&_ "WHERE ((tblAuthors.strLastName Like '%"&strSearch&"%') "& _ "OR (tblAuthors.strFirstName Like '%"&strSearch&"%') "&_ "OR (tblBookDescription.strTitle Like '%"&strSearch&"%') "&_ "OR (tblBookDescription.strDescription Like '% "&strSearch&" %') "& _ "OR (tblBookDescription.strPublisher Like '%"&strSearch&"%')) "&_ "ORDER BY tblBookDescription.strTitle;" end if
'response.write("strSQL = " & strSQL)
Set objRS = Server.CreateObject("ADODB.Recordset") -----------------------------------------------------------------------------error here objRS.open strSQL, objConn, 1, objRS.RecordCount
%> </td> <td valign="top"><font face="Comic Sans MS" color="blue"> <% if strBrowse > "" and Count = 1 then response.write("We Carry " & Count & " " & strBrowse & " book.") else if strBrowse > "" and Count > 1 then response.write("We Carry " & Count & " " & strBrowse & " books.") end if end if
if strSearch > "" and Count = 1 then response.write("Search results: " & Count & " book matches '" & strSearch & "'.") else if strSearch > "" and Count > 1 then response.write("Search results: " & Count & " books match '" & strSearch & "'.") end if end if
%>
thanks for the help
|
| | 4 answer | Add comment |
|
| Classic ASP question Mike P 11:35:16 |
| | I have very little experience of Classic ASP, but I need to take some data from a table, write it to the screen in a tabular format, show a check box at the end of every row, and write some code to enable the user to check all check boxes, and then some code to respond to a button click to find out which rows were checked.
I know how to read data from a recordset and put it into a <table> object, but the rest, particularly the check box bits, are giving me problems. Can somebody please help me out?
*** Sent via Developersdex http://www.developersdex.com ***
|
| | 5 answers | Add comment |
|
| transparent redirection in asp Rvj 11:18:12 |
| | if you redirect on an IIS , must the client url address bar always be updated with the new address. what options are?
Q1 if a user requests http://old.com , is there a method of ASP redirection to http://new.com which does not update the client browser's address bar
Q2 ... or is this one of the main benefits of the IIS URL rewriter ??
Q3 and am I correct in thinking that search engines would only contain indexes for http://old.com
|
| | 19 answers | Add comment |
|
| asp.net integration with Sharepoint Server 2007 possibilities Alvin 01:03:55 |
| | I'm new to both asp.net development and sharepoint 2007. I was wondering if it was possible to design an asp.net application first as a standalone web application and later integrate it with sharepoint when funds become available. The type of applications I'm looking to create are the simple standard data entry screens (master-detail style) and using SQL Server Reporting Services as the reporting solution. I have looked at Infopath forms (maybe too simple) as well as webparts for SP (could be bloated over time?) but neither option really appealled to me.
|
| | 1 answer | Add comment |
Wednesday, 6 August 2008
|
| Getting info from Drop Down Emma 22:29:01 |
| | I'm trying to use a drop down list for the user to select an entery which will goo back to the database and grabs what the user selects then outputs a list using ConnectDatabase.asp. The problem is I don't know how to make input tags for a drop down? Hi I have a html file with the following:
<form name "input" action "ConnectDatabase.asp" method "get">
<select>BedroomSize <optgroup label="Bedroom Size"> <option value = "Bachelor"> Bachelor </option> <option value = "Room / Share"> Room / Share </option> <option value = "1"> 1</option> <option value = "2"> 2 </option> <option value = "3">3 </option> <option value = "4"> 4 </option> <option value = "5+"> 5+ </option> </optgroup> </select> <input type="submit" value="Submit"> </form>
And I have an .asp file with the following <% Option Explicit Response.Expires = -1000
Dim oConn Dim oRS Dim sSQL Dim sColor
Set oConn = Server.CreateObject("ADODB.Connection") oConn.Open("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("\EmilyLeeParsons\db\HHCDataBase.mdb"))
sSQL = "SELECT DatePosted, Area, NearestIntersection, HousingType, BedroomSize, Rent, Details FROM TblHousing" Set oRS = oConn.Execute(sSQL)
Response.Write("<table border=1 cellpadding=1 cellspacing=1 style='font-family:arial; font-size:10pt;'>") Response.Write("<tr bgcolor=black style='color:white;'><td>DatePosted</td>") Response.Write("<td>Area</td>") Response.Write("<td align=right>NearestIntersection</td>") Response.Write("<td>HousingType</td>") Response.Write("<td align=right>BedroomSize</td>") Response.Write("<td align=right>Rent</td>") Response.Write("<td>Details</td></tr>")
sColor = "white"
Do While NOT oRS.EOF
If sColor = "silver" Then sColor = "white" Else sColor = "silver" End If Response.Write("<tr bgcolor='" & sColor & "'>") Response.Write("<td>" & oRS("DatePosted").Value & "</td>") Response.Write("<td>" & oRS("Area").Value & "</td>") Response.Write("<td>" & oRS("NearestIntersection").Value & "</td>") Response.Write("<td>" & oRS("HousingType").Value & "</td>") Response.Write("<td>" & oRS("BedroomSize").Value & "</td>") Response.Write("<td align=right>$" & oRS("Rent").Value & "</td>") Response.Write("<td align=right>" & oRS("Details").Value & "</td></tr>") oRS.MoveNext
Loop
Response.Write("</table><br><br>")
oConn.Close Set oRS = Nothing Set oConn = Nothing
%>
How do I get the information from the html page drop down to the asp page?
|
| | 2 answer | Add comment |
|
| RE: Path=Server.MapPath Steven Cheng 09:54:07 |
| | Hi Betty,
From your descrpition, you ocassionally get some error at the "Server.MapPath" call in your ASP application ,correct?
According to the codesnippet you provided, the Server.MapPath parameter is concatenated via several string. As you said "sCerPath" is always fixed(from environment variable), then the only part may vary is the "order_id" variable, correct?
I've performed some research, it seems some possible causes is the path contains some illegal characters, you can check the following thread:
http://www.xlinesoft.com/asprunnerpro/articles/servermappath_use_strategy.ht m
Also, a kb article mentioned the ".." parent path code is not allowed in Server.MapPath.
http://support.microsoft.com/?id=332117
Sincerely,
Steven Cheng Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and suggestions about how we can improve the support we provide to you. Please feel free to let my manager know what you think of the level of service provided. You can send feedback directly to my manager at: msdnmg@microsoft.com.
================================================== Get notification to my posts through email? Please refer to http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif ications.
================================================== This posting is provided "AS IS" with no warranties, and confers no rights.--------------------
From: =?Utf-8?B?YzY3NjIyOA==?= <betty@newsgroup.nospam> Subject: Path=Server.MapPath Date: Tue, 5 Aug 2008 14:52:15 -0700
Hi all, I have one line code in my program, occasionaly I will receive the following
error: "The Path parameter for the MapPath method did not correspond to a known path"
Path=Server.MapPath(sCertPath & "\" & order_id & ".pdf") I am wondering what is happening since every time I check my error log, the
order_id value is not empty and sCertPath is a system variable. Why does Server.Mappath fail? can you share a hint? -- Betty
|
| | 1 answer | Add comment |
Monday, 4 August 2008
|
| CDOSYS send email with ASP Paulmitchell507 16:19:48 |
| | I have a file called email2.asp which I am using to mail data obtained from a SQL query. I would like to pass the holiday_ID value in the querystring attached to the end of the URL. It all works except that I can't get the value of holiday_ID included as a querystring. As a test I can insert a value after the ?id= and this is passed as a querystring.
I am sure it's just the syntax that I am having problem with
<% Option Explicit <!--#include file="admin_navigation.asp" -->
'Declare variables Dim sch, cdoConfig, cdoMessage, holiday_ID, email, auth holiday_ID = Request.Form("myname") sch = "http://schemas.microsoft.com/cdo/configuration/"
Set cdoConfig = CreateObject("CDO.Configuration")
With cdoConfig.Fields 'Set CDO Port .Item(sch & "sendusing") = 2 'Set mailserver name either IP address, mail.yoursite.com or localhost .Item(sch & "smtpserver") = "192.156.217.6" 'Set SMTP port which is 25 by default .Item(sch & "smtpserverport") = 25 'Set number of seconds before timeout .Item(sch & "smtpconnectiontimeout") = 60 .update End With
Set cdoMessage = CreateObject("CDO.Message")
With cdoMessage Set .Configuration = cdoConfig .From = "administrator@domain.com" .To = "paul@ndomani.com" .Subject = ""& email 'Send the email in HTML format .HTMLBody = "<a href='http://192.156.217.134/authorise.asp? id=holiday_ID'>delete record</a><br><br>" .Send End With
Set cdoMessage = Nothing Set cdoConfig = Nothing %>
|
| | 5 answers | Add comment |
|
| Worldpay integration in classic asp Sajit 14:53:46 |
| | Hi folks,
Currently I am developing a shopping cart in which i need worldpay integartion. I also want customer to be redirected to my web site after transaction. Worldpay also provide default pages for that purpose but i need a customized page on which customer will be redirected after transaction. So do any one have a code snippet which can assist me in integration.
Any help is appreciated. Sajit Nayar.
|
| | Add comment |
|
| programmaticaly changing the default directory page Rvj 10:45:30 |
| | Anyone know if its possible to create an ASP script to reset the default page of a particular directory
|
| | 4 answer | Add comment |
|
| CDOSYS SMTP MM User 00:42:53 |
| | Hi,
I'm using CDOSYS for sending out emails, while designing my asp pages locally I need to set the server to localhost, however for production I need to set it to our smtp server (smtp.companyname.co.uk) is there a way to set IIS to use the smtp server ?
Thanks
|
| | 1 answer | Add comment |
Sunday, 3 August 2008
|
| CDO Message attachment rename Yosi 01:12:40 |
| | Hi All
I have recently changed my send email vbscript to work on W2K3 and I am now using the CDO.Message object. I need to rename files attached to the email without copying / renaming the file itself. With the old CDONTS.NewMail object I used in w2k, this was achieved with AttachFile (FilePath, NewFileName).
There doesn't appear to be a similar function with CDO so I was wandering if anyone had found a function or a way of doing it.
Many thanx in advance Yosi
|
| | 2 answer | Add comment |
Saturday, 2 August 2008
|
| Display Records in certain order (string contained in field) Randy 23:59:05 |
| | Just can't figure out how to do this.......... I have a simple asp page that desplays images from database.
The query on my page: ------------------------- imagequery = "SELECT * FROM FILE_LIST WHERE CLASS_ID=" & FORM_ID ------------------------ The table FILE_LIST contains a field called TITLE which never gets displayed. (the form_id comes from a selection on previous page) I display the images with a do loop as follows: --------------------------- <% set rstemp=conntemp.execute(imagequery) If rstemp.EOF Then Form_file_ID = 0 Else do while not rstemp.eof %> <CENTER><IMG SRC="imagehelper.asp?FILE_id=<% = rstemp("FILE_id") %>"></CENTER> <% rstemp.movenext loop END IF rstemp.close set rstemp=nothing %> -------------------------- I want to have the images that have the string 'photo' within the 'TITLE' field disply FIRST (eg. one with the title 'A photo of a cat' would desplay before 'A drawing of a Cat' ) and THEN the ones that don'tt. I think I can accomplish this some kind of if statement in the loop, but I just cant get it to work without the ones containing 'photo' displaying twice. I hope I've explained this adequately. Thanks in advance to anyone who has any ideas.
|
| | 3 answer | Add comment |
|
| Creating html file from news feed or text file Ellie 22:57:07 |
| | I need to be able to get a feed and then have it displayed on my website. I'm not sure if I can get the feed, but if I can, what would be the best way to create a web page from the feed? Also, if I can't get the feed, I can get daily email updates of google group posts. If I have the email, how could I get that on the webserver so that the web page can display it's contents? I'm very new at asp and I'm just starting to do my research now so I'm not even sure my questions make sense. I've tried to do searches on feeds and nothing seems to be helpful. To make matters worse, the group that I subscribe to requires that you be a member and I haven't been able to access it using googlereader as the search for that news feed comes up as not found. Any help would be greatly appreciated. Ellie
|
| | 1 answer | Add comment |
|
|