Empty Recordset Error
Aug 13, 2004
I am trying to run the following asp function:
Private Function GetAbs(dThisDate, lPartID)
sql_abs = "SELECT AbsCode FROM Absence WHERE AbsDate = '" & dThisDate & "' AND PartID = " & lPartID
Set rs_abs = conn.Execute(sql_abs)
GetAbs = rs_abs(0).Value
Set rs_abs = Nothing
End Function
It works fine if it finds a record but returns an error if it doesn't. How can I avoid this error?
Thanks!
View 2 Replies
ADVERTISEMENT
May 10, 2004
I know, I know this is really an ASP question but I'm thinking that you db gurus write some frontend code too. I have an ASP script (see snippet) that connects to my SQL Server 7 db (see connect string below).
16 sqlUser = "SELECT instructorId, schoolId, salutation, firstName, lastName, phone, email " & _
17 "FROM tblInstructors " & _
18 "WHERE (((userName)='"&Request.Form("userName")&"') AND ((password)='"&Request.Form("password")&"'))"
19
20 Set rsUser = Server.CreateObject("ADODB.RecordSet")
21 rsUser.Open sqlUser, oConn
This code runs fine as long as I key in a valid username and password. If I key in a bad username and password combo the db returns the following to my browser:
ADODB.Recordset error '800a0bb9'
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.
/loginProc.asp, line 21
I tested by writing the finished sql to my browser and pasting it into the Enterprise manager and it runs as expected, I get a record with valid credentials and no record otherwise (but no error).
I'm using SQL Server v7, can anyone shed any light on this? thanks
connect string:
"Provider=sqloledb;" & _
"Data Source=(local);" & _
"Initial Catalog=GradeTrax;" & _
"User ID=sa;" & _
"Password=pword"
View 10 Replies
View Related
Jun 9, 2004
Hello all
I have shifted my vb/access database to vb/mysql and i have one form in my project in which i want to display all the records in the database in the list box . But while doing this i m getting the error " variable uses an automation type not supported in visual basic " . Moreover, it was working in Vb/access .
here is the code
Dim sql As String
intCountSW_ID = 0
sql = "select SW_IDEN, SW_NAME, SW_DELETE,SW_LEFTDATE from SV_SOCIALWORKER order by SW_NAME"
If rs.State = 1 Then rs.Close
Set connString = New ADODB.Connection
connString.CursorLocation = adUseClient
connString.ConnectionString = "DRIVER={MySQL ODBC 3.51 Driver};" _
& "SERVER=;" _
& "DATABASE=shrivatsa;" _
& "UID=root;" _
& "OPTION=" & 1 + 2 + 8 + 32 + 2048 + 16384
connString.Open
rs.ActiveConnection = connString
rs.CursorLocation = adUseClient
rs.Open sql, connString, adOpenStatic, adLockOptimistic
intCountSW_ID = rs.RecordCount
If intCountSW_ID > 0 Then
rs.MoveFirst
While Not rs.EOF
/* here comes the error on the below code
If rs("SW_DELETE") = 0 And IsNull(rs("SW_LEFTDATE"))
*/
Then
lstCaseName.AddItem rs("SW_IDEN") & " " & rs("SW_NAME")
End If
rs.MoveNext
Wend
rs.Close
End If
mfuncFillList = intCountSW_ID
View 1 Replies
View Related
Feb 9, 2007
Hi,
I am converting a VB6 application to C# using ADO. I have the following code:
private ADODB.Connection cn = new ADODB.Connection();
private ADODB.Recordset rs = new ADODB.Recordset();
private connectionString = "Provider=Microsoft.Jet.OLEDB.4.0; Data source= " + stdDir;
strClientSQL = "SELECT * FROM Client ORDER BY casename, renldate, product, fundingcode";
cn.CursorLocation = ADODB.CursorLocationEnum.adUseClient;
cn.Open(Utilities.connectionString,null,null,0);
rs.CursorLocation = ADODB.CursorLocationEnum.adUseServer;
rs.Open(strClientSQL,cn, ADODB.CursorTypeEnum.adOpenStatic, ADODB.LockTypeEnum.adLockOptimistic,-1);
rs.Fields["CaseName"].Value = this.txtCaseName.Text;
rs.Fields["CaseNo"].Value = this.txtCaseNumber.Text;
rs.Update();
When I try to compile and run it I get the following error message:
"No overload for method 'Update' takes '0' arguments"
I am not sure if I need to enter information in the update command or do something else. This seems pretty straight forward but I can't figure out how to do it. Can someone please help me?
Thanks,
Mark
View 4 Replies
View Related
Jul 23, 2005
Dear All,(No aswers on access newsgroups)Access2000.adp connected to SQL-server 2000MainForm unbound: seachform on companies meeting a complex combination ofcriteria.SubFrom and ListBox to display the searchresult ( 2 outputs to test what'sbest).Searchresult is stored in a creatable ADO-recordset (see code) and then1. Converted to string (GetString) to be set as valuelist for a listbox.2. bound to the subform.The Listbox shows the resultdata correctly but is limited in length.The subform shows the records but all fields are empty or displays #errorHow should I bound the controls correctly to display the fieldvalues?If I let them unbound the show up empty.If I set them to the recordsets' fieldnames it show #error.On my Notebook using MSDE there is no errormessageOn my Desktop i get error 7965 not a valid recordset property.CAN'T FIND WHAT'S WRONG! Cursortype ??FilipCODE'Store result in creatable ADO-recordset: Add fieldsWith ResultRSWith .Fields.Append "CompID", adInteger.Append "CompName", adVarChar, 255.Append "BasicPrice", adVarChar, 255End With.CursorLocation = adUseClient.CursorType = adOpenStatic.OpenEnd With[color=blue][color=green]>> Code for Search[/color][/color]'Set Rowsource Listbox and subformIf ResultRS.RecordCount > 0 ThenstrSearchResult = ResultRS.GetString(adClipString, , ";", ";")Me.Formulier1.Form.Visible = TrueSet Me.Formulier1.Form.Recordset = ResultRSMe.CmbSearchResult.Visible = TrueMe.CmbSearchResult.RowSource = strSearchResultEnd IfSearchEnd:'Clear memoryIf rs.State = adStateOpen Thenrs.CloseSet rs = NothingEnd IfIf ResultRS.State = adStateOpen ThenResultRS.CloseSet ResultRS = NothingEnd If
View 1 Replies
View Related
Feb 23, 2008
Hi,
I am using the following code
I use SQLOLEDB Provider
It is not stored porcedure but program code
create new global temporary table with
CREATE TABLE ##tmp123 (...
create and open a recorsset to populate it as direct table
at the open stage I get the following error: Invalid object name '##tmp123'
How can I get it working?
View 2 Replies
View Related
Jun 15, 2015
I am getting an error (number -2147217887, error message "ODBC--call failed.") when I try to execute an rst.Update. I have an MS Access 2013 application using an ODBC connection to SQL Server 2008 r2. I am using a query to update a table. It is a simple Select query with no joins. I have checked to make sure the table can be updated.
I was not sure if there were any special permissions that I need to set to allow a linked table to be updated in MS Access this way?
View 4 Replies
View Related
Oct 2, 2007
I have an update query in an OLE DB Destination (access mode: SQL Command) that updates a table with an INNER JOIN from another table in another database. I'm getting the error, "No disconnected recordset available for the specified SQL statement". Does this have to do with the SQL query trying to access the other database? How can I get around this error?
View 4 Replies
View Related
Aug 12, 2007
To anyone that can help me
we have a application written in straight ASP, we recently upgraded our SQL database connecting to the application from SQL 2000 to 2005 here is the issue
currently SQL 2005 is located in our test and UAT environments, SQL 2005 is not clustered in either location. Now let me make it clear THIS PROBLEM IS NOT HAPPENING IN OUR TEST ENVIRONMENT, I REPEAT THIS PROBLEM IS NOT HAPPENING IN OUR TEST ENVIROMENT, THIS PROBLEM IS ONLY HAPPENING IN OUR UAT ENVIROMENT
Each enviroment is outfitted with the following SQL 2005 environment, Enterprise Edition SP1 with Cumlative hotfix package 2153 just the SISS fix ONLY
now the problem is this, we have a vb program located directly on the server that has SQL 2005 on it that VB program inserts a timestamp into a table inside the database, now how this happens is the program connects to the database and opens a recordset with a forwardonly cursor and inserts the timestamp
NOW THE EXACT PROBLEM IS THAT THE VB PROGRAM CANNOT OPEN MULTIPLE RECORDSETS, THE ERROR RECEIVED IS LABLED LIKE THIS
ODBC DRIVER ERROR 8000405 SHARED MEMORY SQL DOESNT EXIST OR ACCESSED DENIED,
NOW here is the interesting part, AGAIN THIS IS NOT HAPPENING IN OUR TEST ENVIRONMENT, THE VB PROGRAM AGAIN IS ON THE TEST SQL SERVER AND HAS A FORWARD ONLY CURSOR AND INSERTS JUST FINE
NOW IF I MOVE THE VB PROGRAM OUT OF OUR UAT ENVIRONMENT ONTO ANOTHER SERVER IT INSERTS THE RECORD ONTO SQL SERVER JUST FINE, IT OPENS THE RECORDSET AND OPERATES NORMALLY, BOTH SERVERS HAVE EXACT SAME PERMISSIONS
Can anyone help me understand whats happening here
One note, when we changed the cursortype from forward-only to keyset it worked fine but that doesnt explain things
why does it work in test so clearly what we did with changing the cursortype isnt the answer
Thanks please consider this a urgent request
View 5 Replies
View Related
Oct 9, 2015
I have a work database where I implemented a table-valued function. One colleague of mine reported to me that this function gave a Divide by Zero error when executed with some specific values given to its arguments (there are a 15 arguments). Then I started debugging, and I introduced some exit points to the function before its end in order to detect the point where the error appeared, since I don't have access to the database server and I cannot use the debugging tools from remote, due to the network configuration of my office. I can only do attempts on the code to try to find a solution.
Since I didn't manage to get rid of this error, I decided to make a silly and desperate attempt: I put a RETURN statement immediately after the BEGIN of the function body, with the idea that the function should not raie any error if it exit immediately after its beginning, despite the fact that this results in an empty table in return.
The result of my attempt is that the Divide by Zero error is still THERE (!), even if my function looks like
ALTER FUNCTION [dbo][<myFuncName>](...parameters...) RETURNS TABLE (...table definition...) AS BEGINĀ
RETURN
ENDĀ
GO
How I can check it.
View 5 Replies
View Related
Jun 28, 2007
I have developed a report in SSRS 2005. When I try to export the output to Excel, it shows an error saying:
Error occurred during local report processing.
Error occurred during rendering of the report. Stack Empty.
Do anyone have any idea what this means and how to fix it?
I can render the report in other formats (Adobe, csv etc) without any problem. My other reports, under same project and using same dataset, are working fine.
Thanks in Advance.
View 1 Replies
View Related
Apr 5, 2007
Hi all,
Have every night the following error in eventlog:
Event Type: Error
Event Source: SQLWRITER
Event Category: None
Event ID: 24581
Date: 05.04.2007
Time: 03:01:35
User: N/A
Computer: H0xxxx
Description:
Sqllib error: sysdatabases in SQL server instance C0xxxx is empty.
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
Data:
0000: 53 51 4c 53 4e 41 50 43 SQLSNAPC
0008: 32 34 35 35 00 00 00 00 2455....
0010: 53 51 4c 53 4e 41 50 43 SQLSNAPC
0018: 32 34 31 39 00 00 00 00 2419....
Any help is appreciated.
TIA
acki
View 3 Replies
View Related
Sep 15, 2007
I'm trying to import XML Data from a .xml file and then running openXML command to insert relevent data into SQL server 2005.
First I'm importing XML records with help of Script Task(In SSIS) in batch of 1000 records in temporary String n passing this to Stored procedure ,which parses XML String with help of "sp_xml_preparedocument" .This SP it gives following error..
"An object or column name is missing or empty. For SELECT INTO statements, verify each column has a name. For other statements, look for empty alias names. Aliases defined as "" or [] are not allowed. Add a name or single space as the alias name."
I'm clueless about error,can some someone guide to workaround?
View 5 Replies
View Related
Feb 14, 2008
I have a report with a fixed header that works properly when the query returns results (or fixedheader = false). However, when the result set is empty, I get tenacious client-side "object required" errors. Obviously I can either turn the fixedheaders off or disable debugging in IE, but is there a Microsoft fix for this problem?
View 1 Replies
View Related
Dec 27, 2007
Here's a really annoying problem. Let's say you have a text file with 2 million rows.Delimiters all look good and rows are previewed well but the file has a missing row at say lin 1234567 - way deep in the file. When SSIS encounters the blank row, an error is raised and processing on the file STOPS! I verified this in by checking the SSIS log and have even developed an error routine to notify me via email when the error occurs (really cool if I do say so myself ). The main problem still remains - how to resume processing from the point of failure in the file? Any help is appreciated. Thanks.
View 13 Replies
View Related
Jul 10, 2007
Hi,
I am trying to cycle through a table and trigger an event based on some critera. I am not sure how to do it. I am a classic VBA guy, so I might be way off:
Dim myConnection As SqlConnection
Dim myCommand As SqlCommand
myConnection = New SqlConnection("MY SQL DATA SOURCE")
myConnection.Open()
myCommand = New SqlCommand("SELECT * FROM history", myConnection)
Dim dr = myCommand.ExecuteReader()
Dim i As Integer = 1
While dr.read()
i = i + 1
' HOW DO I CYCLE THROUGH THE ROWS AND ASK IF A FIELD EQUALS A VALUE
' field name = "Tail"
If dr(i) = ? Then
MsgBox("ok")
End If
End While
dr.Close()
myConnection.Close()
View 3 Replies
View Related
Jun 22, 2008
Hello, what is the best way to iterate both forward and back through my SQLDataAdapter/SQLDataReader in code?
View 1 Replies
View Related
Jul 24, 2001
In VB to move a recordset, we used .MoveNext. How about in SQL?
How can I compare two fields in SQL?
View 1 Replies
View Related
Mar 12, 2006
hi
I have 3 tables:Article,Source and File.
Each article can have multiple filenames.
The fields of table Article are:ArticleID,SourceID,ArticleDate,ArticleCategory
The fields of table Source are:SourceID,SourceName
the fields of Table File:ID,ArticleID,Filename
Select*from Article inner join Source on Article.SourceID=source.SourceID order by ArticleDate
I obtain a number of recordsets from the above query.
Then for each recordset(Rs1),Let's say for the first recordset
Rs1.MoveFirst
I want to apply this query:
Rs2.Open"Select SourceName,ArticleDate,File.Filename from [RS1] inner Join File on Article.ArticleID=File.ArticleID
I want from the above query to have the Filenames corresponding to each Article because in my VB
form I have 2 command buttons:one gives me the article's definition(Date,Source)
and the other gives me the Filename of the current recordset(Article)
The above SQL syntax is it correct?
View 2 Replies
View Related
Aug 18, 2006
Here's my SQL Statement (I'm using MS SQL 2000):
SELECT TOP 2 MenuComments, MenuDate, MenuID, MenuIsActive, MenuName
FROM Menu
ORDER BY MenuDate DESC
This orders the data correctly, but the problem is, I need ONLY the SECOND row, not the top row. Also, because I am sorting for menus entered into the system, I cannot use a variable based on real dates (in other words, I can't use the server clock to help filter the results).
Any and all help would be GREATLY appreciated -- I've been banging my head against this one all day!
Mike
View 3 Replies
View Related
Jul 11, 2007
Hi,
I am using classic ASP.
Records are grouped together by a GroupUnique number. Some groups are small with about 10 records, othere are larger at about 160.
For each record, I have about 50 columns of data that I need to display on a webpage. Because the 50 columns don't easily fit on the one page, I create two tables, each displaying 26 columns, the first columnn being an ID column. Due to the size of groups, sometimes the tables are very large - and when they get too big it overloads the server.
I think the main problem is the two tables. I use two recordsets (one of them is shown below - although instead of a SELECT * I do in fact name the columns needed for each table). I have to use two because the Recordsets don't like me using the ID column again - once it is used it is gone.
Is there a better way to store all of this information so that I can just use the one recordset? Possibly in an array? Is there a more efficient way of getting the data?
<%
Dim Recordset4__MMColParam1
Recordset4__MMColParam1 = "1"
If (Scramble.Fields.Item("GU").Value <> "") Then
Recordset4__MMColParam1 = Scramble.Fields.Item("GU").Value
End If
%>
<%
Dim Recordset4
Dim Recordset4_numRows
Set Recordset4 = Server.CreateObject("ADODB.Recordset")
Recordset4.ActiveConnection = conn
Recordset4.Source = "SELECT * FROM Table1 WHERE GroupUnique = " + Replace(Recordset4__MMColParam1, "'", "''") + ""
Recordset4.CursorType = 0
Recordset4.CursorLocation = 2
Recordset4.LockType = 1
Recordset4.Open()
Recordset4_numRows = 0
%>
<%
Dim Repeat4__numRows
Dim Repeat4__index
Repeat4__numRows = -1
Repeat4__index = 0
Recordset4_numRows = Recordset4_numRows + Repeat4__numRows
%>
View 4 Replies
View Related
Sep 2, 2005
Hi guys,
my first post. So please don't kill me!
I am having some problems. I'm pretty new to sql and really dont know how to achieve more than the basic selects etc.,
My problem is that I have a recordset on one page http://www.photoghetto.com/photo-images/animals.asp that returns the results of all the images in one category. In this case it's animals and wildlife.
The user can click on any image and go to a page that shows a larger detail version of the image. http://www.photoghetto.com/photo-images/animals-photo-detail.asp
What I do is post the ProductID number to this page so that the selected thumb is shown. So for exmaple for the image of the wild cat it is http://www.photoghetto.com/photo-images/animals-photo-detail.asp?ProductID=6
My problem is that on the animals-photo-detail.asp the user has to be able to "scroll" through all the images from the category.
I.e should be able to hit the previous image button and see the stallion image, or the next button to see the butterfly etc., and thus scroll through all the images on this age if he/ she wishes to.
I understand the principles of having a results page and then being able to click on one of the results and getting a detail page. Such as I have it here. With the http://www.photoghetto.com/photo-images/animals.asp as a results page listing all the results of the category, and then when the user clicks on one of the results, goes to a detail page, for example, http://www.photoghetto.com/photo-images/animals-photo-detail.asp?ProductID=6.
My problem is that what I need is the recordset from the listing page to function on the detail page so that the user can scroll through the results in the same order that they were on the results page.
I have searched now for a couple of days online and every tutorial I find shows the same structure. Results Page > Detail Page.
The sql i am using on the detail page is simply,
<%
Dim photos_rs__MMColParam
photos_rs__MMColParam = "1"
If (Request.QueryString("ProductID") <> "") Then
photos_rs__MMColParam = Request.QueryString("ProductID")
End If
%>
<%
Dim photos_rs
Dim photos_rs_numRows
Set photos_rs = Server.CreateObject("ADODB.Recordset")
photos_rs.ActiveConnection = MM_photo_STRING
photos_rs.Source = "SELECT * FROM PHOTOCOLLECTIONS WHERE ProductID = " + Replace(photos_rs__MMColParam, "'", "''") + ""
photos_rs.CursorType = 0
photos_rs.CursorLocation = 2
photos_rs.LockType = 3
photos_rs.Open()
photos_rs_numRows = 0
%>
So I understand why it will only display the one result since thats the detail page.
Is it possible to be able to scroll through the results using the previous and next buttons as I have setup in the display on the http://www.photoghetto.com/photo-images/animals-photo-detail.asp page. For example, http://www.photoghetto.com/photo-images/animals-photo-detail.asp=ProductID=6.
Since the resutls are gathered from across the database its not possible to have a href tage that does a <<< http://www.photoghetto.com/photo-images/animals-photo-detail.asp=ProductID=(6 -1) or a >>> http://www.photoghetto.com/photo-images/animals-photo-detail.asp=ProductID=(6+1).
I guess it has to be something with a recordset index but does anyone know how to do it? And does anyone have the ability to help me do it?
My boss is kicking my butt now to get this thing online at some point today, and I'm turning to you guys for help if possible.
I'm sorry if this is a stupid question. I've really ran out of ideas.
-SOM
View 9 Replies
View Related
Mar 27, 2007
is there any thing like a recordset concept in sql server,
where i could loop through and update each rows
Thanks,
MG
View 5 Replies
View Related
Nov 23, 2005
This asp code displayes records in a combo box:<%openDB()call updateDB("usp_retrieveOptions",rs)if not rs.eof then%><tr><td width="66">Options</td><td width="137"><select name="select1" class="TextField1"><%i = 0do while not rs.eofif rs(0) <> Arr(i) thenresponse.write "<option value=" & rs(0) & ">" & rs(1)i = i + 1end ifrs.movenextloop%></select></td></tr><tr><td colspan="2" width="206"><center><table width="71" border="0" cellspacing="3" cellpadding="0"height="33"><tr><td width="9" height="30"><input type="submit" name="Assign" value="Assign"></td></tr></table></center></td></tr><%end ifcloseRS()closeDB()%>The call updateDB("usp_retrieveOptions",rs) invokessub updateDB(SQL,rs)set rs = objConn.Execute(SQL)end suband my usp_retrieveOptions stored procedure:create procedure usp_retrieveOptionsAS SET NOCOUNT ONSELECT OptionID, Description FROM OptionsReturnGOnow in my asp code when I try response.write rs.RecordCount I am getting-1 all the time. How do I solve the problem. Your help is kindlyappreciated.Eugene Anthony*** Sent via Developersdex http://www.developersdex.com ***
View 4 Replies
View Related
Jul 20, 2005
Im doing a select that should retrieve a name from one table and display thenumber of correct bets done in the betDB (using the gameDB that has info onhow a game ended)I want the "MyVAR" value to be used in the inner select statement withouttoo much hassle. As you can see im trying to get the "MyVAR" to insert inthe bottom line of the code.Whats the quick fix to this one..?Thanks in advance :-)---------- code begin ----------select memberDB.memberID as MyVAR, (select count(GamesDB.GameID)from GamesDBinner join GameBetDBon GameBetDB.betHome = GamesDB.homeGoal and GameBetDB.betAway =GamesDB.awaygoalinner join memberDBon memberDB.memberID = GameBetDB.memberIDwhere GamesDB.gameID=GameBetDB.gameIDand GameBetDB.memberID= MyVAR ) as wins from memberDB---------- code end ----------
View 1 Replies
View Related
Aug 25, 2006
Hi allHow do i declare a recordset and fetch records from an sql server?TIAGuy
View 3 Replies
View Related
Jun 22, 2004
Hello,
I am connecting to the database as following:
set con = server.createobject("adodb.connection")
con.open "connectionstring"
set rs = con.execute("select * from tablename")
I am able to display the records but if I want to give adopenstatic to the above connection, how can I do so?
Thanks in advance,
Uday.
View 1 Replies
View Related
Nov 24, 2001
Hello,
I have some problems to edit a recordset in an ActiveX DTS using Vbscript.
Here is an example of the script :
dim varsql, varset, varconn
set varconn = CreateObject("ADODB.Connection")
set varset = CreateObject("ADODB.Recordset")
varconn.Open = "Provider=SQLOLEDB.1;Data Source=(local);Initial Catalog=Enregistrement3;user id = 'sa';password=''"
varsql = "SELECT * "
varsql = varsql & "FROM mytable "
varset.Open varsql, varconn, 3,3
msgbox "How much : " & varset.recordcount
if varset.recordcount >0 then
do while varset.eof
varset.edit
.........................
varset.update
varset.movenext
loop
end if
varset.close
varconn.close
Does someone see what is wrong ?
I allways get -1 for the varset.recordcount ! (I checked there are some records into the table).
I don't think it is a problem of user's right as it works with the same user configuration using a SQL action requery.
If I modify the open statement like this :
varset.Open varsql, varconn, 1
varset.recordcount contains the good number of records but the recordset is read noly and can't be modified...
Any Help will be very wellcome !
TIA
View 1 Replies
View Related
Sep 29, 2000
Is possible use DTS for return Data in recordset in the VB ?
I am asking this , why I have access the database INFORMIX, and several things do not work with Stored Procedure in the Informix
thank you in advance
View 1 Replies
View Related
Aug 30, 1999
What I have to do is loop through a table with about 900 records, do computations on each record and update a database, can someone help me out.
here is the code that I am using right now on another site with coldfusion but i want to convert it all to a stored proc for speed reasons.
<!--- Query the Stores Table --->
<cfquery name="Zip2" datasource="#application.data#" username="#application.username#" password="#application.password#">
exec Stores_GetStoreZipInfo
</cfquery>
<!--- Loop through the STORE table --->
<cfloop query="zip2">
<cfset Lat1 = #zip1.lat#>
<cfset Lg1 = #zip1.long#>
<cfset Lat2 = #zip2.lat#>
<cfset Lg2 = #zip2.long#>
<!--- Do the actual distance calculation between the user's zipcode each store's zipcode --->
<cfset DistLat = 69.1 * (Lat2-Lat1)>
<cfset DistLong = 69.1 * (Lg2-Lg1) * #cos(Lat1 / 57.3)#>
<cfset Dist = ((#abs(DistLat)# * 2) + (#abs(DistLong)# * 2)) * 0.5>
<!--- Update the DISTANCE field on STORE table --->
<cfquery name="UpdateZips" datasource="#application.data#" username="#application.username#" password="#application.password#">
exec Stores_UpdateZipSeachInfo '#Dist#', '#zip2.zipcode#'
</cfquery>
</cfloop>
View 1 Replies
View Related
Apr 19, 1999
I'm an SQL novice, but I know this must be a common problem.
I'm trying to select a recordset (using ASP), but I know I only want part of the recordset, and am not sure how to limit it ahead of time.
For example, the query will return about 500 rows, but I know I only want to use a small section of these records.
I want to give the user the ability to navigate through small sections of these 500 rows without having to get all rows all the time.
I know ahead of time which rows to get, but have no idea how to limit the recordset before I get it (there is no fields in the database to help).
This is what I'm doing now. "select * from xyz where id=xxx order by date desc;" I know I only want the first 10, or 10-20, or 400-410.
The way I'm doing it now, I'm getting the whole recordset each time, doing a "rs.move x" where x is where I want to start.
This is really a waste of network traffic and memory since my SQL server is on a different machine as the web server running ASP.
How do I do this?
Please email me if you could at pmt@vantagenet.com
View 1 Replies
View Related
Aug 2, 2004
hello,
i have a select query that returns multiple rows (within a cursor). How do i loop through the rows to process it (in a stored proc)? I donot want to use nested cursors. a code sample is requested.
thanks!
View 3 Replies
View Related
Nov 12, 2004
I have a reference table that looks like this
id | value
==========
1,abc
1,def
1,ghi
2,def
2,jkl
I want these values to go horizontally into another table matched on id, to look like this:
id | value
========
1,abc def ghi
2, def jkl
I built a cursor to parse through it but was taking forever (there's 185,000 records in the reference table). Any idea's on the fastest way to perform this function?
View 1 Replies
View Related