Why Paramater Values Are NULL When Page Is In EXCEL Format?

I have 3 asp pages. The first page (login.asp) takes the parameter values(userid, groupid, locationid and deptid) based on the login (validate using a table). On submit the page params.asp is executed. Here the user has to select the filtering.

Then the page results.asp is executed. When the result is in excel format only the parameter value p_attdate (p_attdate is the value on page params.asp) contains a value.

The value of p_gid(p_gid is a session variable) remain null. BUT when the output is in html format, the parameter value p_gid return the correct value. I want the output to be in excel format but the sql statement is returning the wrong result. Only p_attdate is returning the correct value. I think because p_attdate is a form variable.

Can anyone tell me why value of p_gid is always null when the output is in excel format???

View Replies


ADVERTISEMENT

RecordSet (and GetRows) Is Retrieving Null Values When They Aren't Null

I have an interesting situation that needs to be addressed ASAP.

I am running a standard SQL Query in ASP to retrieve some rows/columns from a table that's on a SQL Server 2000 database. I put the results of that query into a RecordSet, and then use the GetRows function to push the results that are in the recordset into an array variable. In the query that I am running, 39 columns and 2 rows are returned.

The GetRows function appears to be working - the array variable is being created with the proper dimensions. However, the values of the different "cells" of the array are not showing up correctly. The first and the last column values for each row are correct, yet everything else in between is blank, empty, NULL, or whatever.

In other words: ArrayVariable(0,0) shows up correctly, ArrayVariable(38,0) shows up correctly, but everything in between is null.

I did a test on the RecordSet and discovered that it was the culprit - it wasn't being filled in properly. This is strange, though, because the select query that I run in the ASP code to create the recordset returns perfect results when I run it on the SQL Server 2K database.

View Replies View Related

NULL Values In SQL

I have 2 questions about SQL server. First, what should i do about allowing NULL values when designing the database? What difference does it make? And if I disallow NULL values, should i enter default values?

Second, when adding new records to database with recordset.addnew, what SELECT statment, cursor, and lock type should i use?

I've always used "SELECT * FROM Table" and adOpenStatic, and adLockOptimistic. This SELECT statement looks very inefficient to me, but I don't know what else to use.

View Replies View Related

Inserting NULL Values

How do I tell my SQL Server database to insert a NULL value for an empty string. Like if I set a value to null in ASP like this: x = null then it inserts as empty in to the database, how do I get it to insert a reall null value?

View Replies View Related

Checking For Null Values

i have a null value in one of my session variables.

So i tried using this:

if Session.Contents("Department") = "" then
response.write "DEPARTMENT IS NULL"
end if

it doesn't work though.

Session.Contents("Daepartment") = null doesn't work too.
how should i do the checking to check for null values?

View Replies View Related

Empty/Null Values In SPs

My typical code to call an Stored Proc in ASP is as follows ...

View Replies View Related

Null Values From Recordset

I'm reading records from a recordset and placing them in a table. One of these fields is a date value and I format it using the following:

Code:

<%=FormatDateTime(oRs.Fields.item("DateRecd"), vbShortDate)%>

If this field contains no data, how can I display it without getting an error?

View Replies View Related

Inlcude Null Values In Result Set

I'm working with an Access DB, and two tables. This is going to be ported to MS SQL shortly. The tables are category and merchantcategory, and the link is on category.id and merchantcategory.category_id.

*** Category Table ***
id, category
1, apples
2, oranges
3, lemons

*** Merchantcategory Table ***
id, category_id, merchant_id
1, 1, 1
2, 3, 4
3, 3, 19

What I need to do is something like
SELECT category, count(merchant_id) AS merchants
FROM category, merchantcategory
WHERE category.id = merchantcategory.category_id
GROUP BY category
ORDER BY category

But, I need the merchants column to either return 0 or NULL for those categories that do not have an associated merchant. I would like to see something like:

1, 1
2, 0
3, 2

A. Is this possible?

B. If it is, what do I need to do to get the result? I would prefer not to have a bunch of record sets and loops.

View Replies View Related

Problem With Len() Function & Null Values

i've come across a real head-hurter. I'm looping through a recordset and
response.writing it's rows out with no problem except 1 field. The field
type is varchar and contains words like meeting, holiday, etc.

Problem is, I'm trying to render a "n/a" when the field is null as in
LISTING 1 below. My code isn't catching the null values. How can I test for
null values? I could swear I've successfully used the Len() test like below
successfully on similiar null varchar fields, but perhaps not.

Any ideas?

LISTING 1:

If Len(objRS(7)) < 1 Then
xTeamName= "n/a" ' this is problem line
Else
xTeamName = objRS(7)
End If

View Replies View Related

Excel String Value Returning NULL

I'm reading from an Excel spreadsheet to insert the data into a database.

The problem is with a column that contains both numerical and text values. I'm inserting this column into a text field in the database, but for some reason any value that contains a text character, EG K121212, is returning NULL when it's read.

I'm debugging at the moment by writing the values out to the screen using:-
if not isnull(excelrs.fields.item(2).value) then response.write("<td>"&excelrs.fields.item(2).value&"</td>") else response.write("<td>NULL VALUE</td>")

If the column contains 121212 then it writes to the screen. If it contains K121212, it writes NULL VALUE.

I've tried converting the whole column to text; same result. I've tried putting a ' infront of the text values; same result. I'm sure I had this problem before and fixed it, but it's happening again and nothing I try is sorting it.

View Replies View Related

Paramater For Cnn.EXECUTE?

How does one pass a parameter to the EXEC query recordset:

set rs = cnn.execute("EXEC tblListings_qry2")

View Replies View Related

Asp To Excel Format

<%Response.ContentType = "application/vnd.ms-excel"%>

which save my asp query to excel, but the TYPE of excel it saves as is WEB PAGE. is there a way to save as a excel workbook?

View Replies View Related

How Do I Format Excel Columns In ASP?

I'm using Response.ContentType = "application/vnd.ms-excel" to display my SQL filled table in Excel and all the data shows up, but the column formats are not correct. For example, Excel treats my column with data such as "01-80" as date "Jan/1/80" and I want it to stay as a string. How do I specify the column format as text inside my ASP code?

View Replies View Related

Excel Download Format

i have a excel download which works fine, but the format is incorrect if i need to re-upload the worksheet to the database via a file upload.

so i think the problem is that in the download i am using a table format with <tr><td> etc. how can i change these to just be cell entries?

View Replies View Related

Resultset Output In Excel Format

I have written an ASP script that connects to a database and runs a stored procedure and displays the results in text format ...using the <TABLE> tag. But I would like to
have these results appear in a NEW Window in an Excel format. I used :

<%
Response.ContentType = "application/vnd.ms-excel"
Response.Buffer = true
Response.Clear
%>

This opens up Excel in the same window and usually does not refresh my data ...even though the stored procedure is actually running on the database server.

View Replies View Related

ASP-Excel :External Table Is Not In The Expected Format

My program exported a excel file by using

Response.ContentType = "application/vnd.ms-excel";after downloading the same when i import it back to my system using Microsoft Excel driver, i got an error.

External table is not in the expected format. Do anyone know how to solve it?

View Replies View Related

Exporting Datagrid To Excel: Format Cells?

I'm exportin a datagrid to excel, but Excel file is without format colors cells border...
Do you know how format it? Code:

View Replies View Related

Checking The Format Of The Excel File Uploaded

I would like to inquire how would it be possible to use asp to check the format of the excel being uploaded? Like the first row in cloumn A is named Results, column B is named Example and so on.

I've already able to use asp to to extract the data from the excel and insert them into the access ab. Now I would like to know how to be able to check the format of the excel file being uploaded, if it is the way i want then it would proceed to insert the values into the access db, if not the user will be informed that the format of the excel file was not the standard one.

View Replies View Related

Checking The Format Of The Excel File Uploaded

I would like to inquire how would it be possible to use asp to check the format of the excel being uploaded? Like the first row in cloumn A is named Results, column B is named Example and so on...

I've already able to use asp to to extract the data from the excel and insert them into the access ab.

Now I would like to know how to be able to check the format of the excel file being uploaded, if it is the way i want then it would proceed to insert the values into the access db, if not the user will be informed that the format of the excel file was not the standard one.

View Replies View Related

Read Data In An Excel File And Than Write It In The Format Of XML?

How can I use ASP to read data in an Excel file and than write it in the format of XML?

View Replies View Related

Fetch Values From Excel

I have an excel file having textfields, I want to get its value from the ASP page. What is the way to get it?

View Replies View Related

Access, ASP And Page Format

I have a site using Access 2K and ASP.
The site uses frames and the ASP page appears in between two of the frames;
so I have a limited amount of space to present the DB information. I want
the ASP page to have a restricted number of characters showing horizontally
and to automatically wrap if the line limit is surpassed. Can this
formatting be set in the ASP code for particular fields?

Also, I'd like to indent some of the data that's being pulled from the DB.

View Replies View Related

Values From Asp Page To Html Page

I have a web form page that passes values to an asp page, in which an email is sent to the customer with those values. The email functionality works fine. But I also want to display these values on a separate "thank you" web page after that.

What is the code to make those values display in the "thank you" web page? Does this involve adding code to the asp page and the "thank you" html page as well?

View Replies View Related

Passing Values From Page To Page

I have code that gets its values from a Request.Form it then inputs the data into the Database.The problem is when I do A Response.Redirect back to the original page I would like to pass a value back to a hidden field in the original page. Psudo Code

index.asp ---> User enters data from drop downs ---> values get passed to insertintodb.asp ----> then ----> Repsonse.Redirect's back to index.asp where I would like to get the values from the insert statement back into this page as hidden field so It can be passed to another page based upon the users next actions.

View Replies View Related

Multiple Page Values

i want to submit 30 field(textbox,combo etc.) data into database.if i take all 30 fields on same asp page or form,the page will not look good, so i want to break that into 3 pages,each page will having only 10 fields.when all required fields on first page will be filled by the user then he will click on next button,so he will see next page , i.e. page no. 2,same for page 3.

if he want to come on previous page for editing some info,it should be possible.on 3rd page there is submit button,when he clicks on submit all the info will stored into table. can anyone tell me is it possible using ASP 3.0? if it is possible then tell me how to do this?

View Replies View Related

Get Hidden Form Values From Another Web Page

I received the following bit of code from a friend in need of help. I've done all I can do so far and need assistance with the rest. This code is supposed to get a web page and grab the necessary info from it so it can be used. After the page is grabbed I need to grab the values of 3 "hidden" input fields in a form.

The fields look like this:
<INPUT TYPE="HIDDEN" NAME="VARIABLE1" VALUE="CD5E56C4E89CFBE470D8B098C6897BABB6C037FD784765B0">
<INPUT TYPE="HIDDEN" NAME="VARIABLE2" VALUE="CD5E56C4E89CFBE4B1B8B011899A4B44CCC7B734481F19ED67745C61F9EF16D0">
<INPUT TYPE="HIDDEN" NAME="VARIABLE3" VALUE="D8F1A38F99B9320B">

The code I have looks like this. I need help getting started on how to search thru the retrieved web page to get the above values.

If someone knows of better code than what I have so far please feel free to enlighten me with it. Code:

View Replies View Related

Form Values On Asp Edit Page???

I'm trying to setup something that adds/edits records to an access db using vbscript.

I've got an html form with text, select and textarea inputs.

These values get passed to an asp page that UPDATES the record (not INSERT because it's actually appending to an existing record). Because this page is also an EDIT page, I SELECT all the values so as to:

1) display the current value for editing

2) make sure if they're not edited the value is not null when submitted

My questions:

It's no problem populating the values of form "text" inputs, but how do I do the same for

a) the "select" inputs (Make the proper value SELECTED)? and
b) the textarea input?

ie. The user goes to the page for the first time and there aren't any values yet. They use the various form inputs to add values. When they come back to edit the same record I need to display current values of all form fields properly. Code:

View Replies View Related

Passing Values To An HTML Page

I have a web form page that passes values to an asp page, in which an email is sent to the customer with those values. The email functionality works fine. But I also want to display these values on a separate "thank you" web page after that.

What is the asp code to display those values into the "thank you" web page? Does this involve adding code to the asp page and the "thank you" html page?

View Replies View Related

Send Values From One Page Form To Another

one page displays the values which have just been retreived, and i want those values to transfer to the next page which is a booking page.. Code:

View Replies View Related

Export To Excel From Asp Page

am creating a asp page that wiil fetch data from database and export that to excel. not using excel objet, am creating a HTML table to display the data. Now that it displays the data correctly in IE, I want to it to be stored in excel file too.

If I create a file in code, it creates the file. But the file shows up 0 bytes. and holds nothing. Anybody pl guide me how would I redirect my output to the excel file.

View Replies View Related

Importing ASP Page Into Excel

I was having a go at importing a page written using HTML embedded with some ASP and SQL commands into an Excel sheet.

Now I have tried using the command below and no luck. After doing some Google searching I found some people suggesting removing HTML and BODY tags which I did but no luck. Tried using HTML and BODY tags and still no luck and all of a sudden I hit a brick wall. Code:

View Replies View Related

Excel Spreadsheet In ASP Page?

What would be involved with having an Excel spreadsheet displayed in an ASP page? The additional problem is that the file name changes on a monthly basis. For example, this month's file name is 'Feb 2005.xls'.

View Replies View Related

Write All Defined Vars And Their Values To Page?

for debugging purposes, I am wondering if it is possible to have an ASP script that:

-creates a tabel with two columns
-writes a var name in the first column
-writes its value in the second column

is this possible? Right now, I have manually created this tabel for myself, but everytime a new var is defined, I have to update my 'debug' table. Can this be automated?

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved