Read A Recordset Into A Variable So I Can Disconnect From DB And Use Results?
This seem to be a simple question, but I'm having no luck with Google
keywords...
I have an some ASP in which I open a recordset via a connection to a MSSQL
database. I don't want to keep the database connection open while I'm
processing the data from the resulting recordset.
Is there a method that I can use to copy the recordset into an array
(collection, etc), the close my DB connnection and finally process the data
I copied from the recordset?
View Replies
ADVERTISEMENT
I keep getting the BOF and EOF error message. My code is testing for entries within the database only from the current. If an entry of the current day doesnt exsist VBScript will spit the EOF /BOF error. I can i get pass this and still display my form as I want to. Here is my code:
View Replies
View Related
i have a recordset in a results page
this retrieves all records but i only show the first 6 with all details (using a repeat region)
then i want to follow this with just thumbnails of the additional results
- this repeat region uses the horozontal looper
Either i need this second repeat region to start at number 7
or i need another recordset but with sql to ignore the first 6
(database is access)
can anyone offer any guidance on either solution?
View Replies
View Related
Is it possible to grab recordset even after SQL throws error, but also returns data?
View Replies
View Related
I have a database with several hundered images and I need to retreive them using recordset paging, otherwise the page will be to long. So far so good.
I added a search function which will return only the desired results. The first page returns the search results (30 per page) and I also have a line of code that tells me how many records was found, let's say 70. This should give me 3 pages of results.
But when clicking on the next link I don't get the next set of results, instead ALL the images from the database is returned on the following pages, starting from image 31 in the DB. Not just the rest of the originally search results. Code:
View Replies
View Related
Does anyone know of any easy way to have shading on alternative rows in a table that loops through the rows in a recordset?
View Replies
View Related
I have an ASP page that is reading records from a SQL database and passing them as a string to a DIV. I would like to do that using XML. SQL 2000 has this great XML, AUTO feature that I would like to utilize. My retrieval code goes something like this:
set objSQL = CreateObject("adodb.connection")
set objRS = CreateObject("adodb.recordset")
objSQL.Open "Provider=sqloledb; Data Source=MYDB; Initial Catalog=MYTABLE;"
objRS.Open "SELECT * FROM MYTABLE XML AUTO, ELEMENTS", objSQL
So, now I have a recordset with the XML code in there. How do I get at it? Let's say I want to Response.Write it.
View Replies
View Related
I have client who has database full of crap. One field in the "property" table is imageurl. I have been able to successfully extract only the file name from the string, such as "2030323.jpg". All images are stored in a directory called "listings". What I am trying to do is to loop through the recordset, and read each imageurl.
If there is an image file in the "listings" directory, then delete the file. It appears that some fields contain imageurls that no longer exist in the listing directory. Here is the code I have so far, I almost had it, as it told me at one point the file didn't exist. Then I screwed up the code and this is where I am at: Code:
View Replies
View Related
I have a problem in my project to read backward start from the last record in my database. I need to display the graph using asp and SQL server as my database.
How can i set in asp coding to read from the last record then go to the previous record before i can display the graph... Code:
View Replies
View Related
I have a variable in an INI file (fileLocation) which will point to the location where i can store some temporay files.
This fileLocation variable has a value "%USERPROFILE%Local SettingsTemp" >Now, how do i get the actual expansion of this variable (for ex:i.e : C:Documents and Settings<username>Local SettingsTemp).
How can this be achieved through ASP?
View Replies
View Related
Is it possible to read any ASP variable from a javascript file (.js) ?
View Replies
View Related
I want to use vbscript to run a script multiple times and save its results to a text file. I have practically wrote this script before but only using a sql command wrote in to the script. However, this is a lengthy sql file so can not be directly entered in to the vbs script,s o I would like to run it using sqlcmd.
"SQLCMD -S "&WScript.Arguments(0)&" -i "&WScript.Arguments(1)
I have tried Googling this problem but found very little information about it. Any discussions online that I have found show no code and assume you already know how to do it.
I have found this so far:
Set objShell = CreateObject("WScript.Shell")
Set objScriptExec = objShell.Exec("sqlcmd -S "&WScript.Arguments(0)&" -i "&WScript.Arguments(1))
But how do I get hold of the results in to some kind of variable?
View Replies
View Related
I have a batch file that takes variables from the cmd and passes them by sqlcmd to an SQL script. When I pass the variable 'MikeTestList' the script runs as expected with no problems. When I passed 'BulkTransferTest' I got an error message, 'The string or binary data will be truncated'.
Some testing has shown that I get the error when the string is anything above 12 characters. Is there a limit to the length of a string you can pass using sqlcmd from a batch file? Is there any way around it?
Also, if I have a space in the string, it only passes the string up to the space. I have tried to fill it with a '%' which then gets passed as is, so the % stays in place through out the script. Code:
View Replies
View Related
this is my sql statement and i would like to retrieve the recordset in ASP.I tried retrievin like i just to for single tables e.g. MainMenu = Reponse.write RS("M.LinkMainMenu") but it looks like I cant do it when i try to join 2 tables.
Errormessage = ADODB.Recordset (0x800A0CC1)
Item cannot be found in the collection corresponding to the requested name or ordinal.
strSQL = strSQL & "Select M.LinkMainMenu from tblMainMenu M, tblSubMenu S where"
strSQL = strSQL & " M.LinkMainMenu = S.LinkMainMenu Group by M.LinkMainMenu" .
View Replies
View Related
Having an issue trying to access a variable that is populated by a value inside a recordset that I want to use in another statement. I've included the source code below:
" Do While Not objRSZone.EOF
strSuburb = objRSZone("suburb")
strZone = objRSZone("zone")
strPostCode = objRSZone("postcode")
If frmSuburb = strSuburb Then
Response.Write "Zone for " & strSuburb & " = " & strZone & " , Postcode = " & strPostCode & "<br>"
strShipZone = strZone
Response.Write strShipZone
End If
objRSZone.MoveNext
Loop "
So what I want is to use the strShipZone variable somewhere other than this place above. But it doesnt work, as it is on the loop, if i put it outside the loop it is populated by a wrong value.
View Replies
View Related
Im having a few prblems with object recordset and
variables. I can print data into a table using
objrecordset("Type").
But when i try to assign the value
to a variable, ex. variable1=objrecordset("Type") i get
an invalid use of null error. If i take out the code to assign
it to a variable it works fine. So my question is how can i
assign the value of objrecordset("type") to variable1.
View Replies
View Related
Lets say I have created a Recordset named MySET. And I have a value passed from a form: Request.Form.Key(1) Code:
View Replies
View Related
Last week, my shopping cart was still working well until I began getting the following errors 2days ago..
Error Type:
ADODB.Recordset (0x800A0BCD)
Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.
../order/saveorder.asp, line 157
Browser Type:
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
Page:
GET /main/saveorder.asp
Could you check my code below and let me know what possibly the error is?
View Replies
View Related
I'm turning my application into a "DLL". Everything worked fine untill I try to do a "While" in my asp code. Then I recieve an error like this:
"Object variable or With block variable not set"
My vb code look like this.....
View Replies
View Related
is there any way of passing a javascript variable over to a asp variable so
i can write it to my database.
View Replies
View Related
I have created a forum, in which I have 3 tables:
1: Table_Forum
2: Threads
3: Replies
I have it at the moment that on the main default.asp there is a recordset that will
display all records within that table, these are a list of forums that will be available.
I have a table that will show the forum name, and the description. This table is then looped using Do while not, now what i need to do is show how many records in the Treads table are related to each forum using asp. Code:
View Replies
View Related
How do I convert an ASP variable to a Javascript variable?
View Replies
View Related
Anybody know how to get only the 10 latest results of an SQL query ?(in SQL)
View Replies
View Related
sql = "SELECT * FROM & console &'news'"
I got that right now but i want the variable, console to be placed along with news so when it selects from the db it selects from gcnnews or whatever variable it's on. How do I do that?
View Replies
View Related
im trying to subtart one quantity from another then stick the answer in to an update statment, but all i get is an error in syntax message
variable math bit=
qty=request.form("oqty")-Request.form("qty")
sql =
sSQL="Update spares SET spares.location='"&request("location")&_
"',spares.machine='"&request("machine")&_
"',spares.part_desc='"&request("part_desc")&_
"',spares.part_number='"&request("part_number")&_
"',spares.qty='(" & qty & ") "&_
"',spares.min_qty='"&request("min_qty")&_
"',spares.updated_by='"&session("name")&"' WHERE(spares.id)=" & form_id
View Replies
View Related
I need to assign a value to a variable, but this variable name is dependant upon another variable!! I am including the code below so you can see it, cos if not I am sure you are thinking whattt?? Code:
View Replies
View Related
i have a record that is returned by the database as domain/username. i want to be able to strip off "domain/" and just display "username". is this possible? if so, how would i go about doing this?
View Replies
View Related
i don't know what to do here exactly.
i have seen the TRIM function, but i'm not sure if it's the right way to do it.
i have a recordset called RSUSEREDIT.
in the recordset there is a column called "EMail".
i can print out the results using Code:
<%=RSUSEREDIT("Email")%>
the email column always uses the same domain name... - username@domain.com
is it possible to remove the part after and including the "@"?
View Replies
View Related
I have a URL... everything returned by the url, I need to write to a file. lets say its 40 lines of text... how can I write it to a text file and save it??
ADODB stream?
FSO?
DomObject?
View Replies
View Related
I'm creating a site that pulls details from a database & display it on screen. Problem is that there's sometimes loads of data which makes the page huge. What I want it to do is display ten and a next page link to display the next ten. Like the way Google displays results. Problem is I don't know how to generate pages on the fly. So the question is can it be done and does ne1 know how to do it?
View Replies
View Related
First, thanks to all who have helped me over the last few weeks !!
I have a form that allows the user to select multiple options.
These are user names:
Fred S
Bob D
Paul G
Dave O
When the form is submitted, I'm getting the details using
user = request.form("user")
this is returning the mutliple options.
What I would like to do is pass all the options to 'user' but at one
point on the results page only show the first user selected, not the
multiple selection
View Replies
View Related
what is an easy way to go about sorting my search results through links, you know, like clicking the link at the top of a column. i know how to pass the order by in a querystring:
http://www.example.com?lastname=smith&firstname=john&state=GA&orderlast=desc
where orderlast is the order querystring.
but what about all the other links? what do I do with the previous querystring entries like lastname, firstname, and state? i find if i add orderlast to my lastname column and i click on it, i will have 2 orderlast querystrings
View Replies
View Related
I'm using multiple recordsets on a page, and they are all returning correct results and enough of them. My problem is when I try to access the recordcount property rs.recordcount, they all return a result of -1. This would usually mean that no records are returned. So why is showing my recordsets that are displaying records with recordcounts of -1. I can't seem to figure out.
View Replies
View Related