I'm getting an error when I'm retreaving from a "text field" in the database and it has no data in it. I'm using MYSQL version 3.23.58-nt. I have the same script running a different system and I don't get this error. It justs output nothing and continues with the loop.
This has to be an ASP problem when retrieving data from the database. I've change the Field for Message to "varchar(252)" vice "text" in the database and stoped giving me error. But I still need to use the type "text" in the database since my "Message" will be longer then 252 caracter. Code:
I have a page with a drop down box and a text field. The drop down box selects a column from a table in my database. txtField is the drop down box and txtSearch is the text field.
The form method is post and the results are passed to the next page which has the query for the database as shown below. Anyone any ideas why I get no results from the query? It works in queryanalyzer so I assume its my asp thats wrong? Code:
i want to count all the records in my database where a certain field is empty.
heres my statement: "SELECT Count(*) As Total FROM table WHERE field1='value' AND field2=' ' "
gives an error. If it not possible. can the next be done: 1 count all the records. 2 count the records where field2='Yes' 3 subtract the two to get where field 2 is empty?
i know it's just something small, but i can't seem to figure it out. i also tried field2 != 'Yes'
I'm listing records from my db and each company has 3 address lines ie address, address2, address3. In most cases 3 and sometimes 2 are empty. As my ASP looks like this
then I end up with the first line of the address and two blank lines. How could I avoid that by checking if the fields have content, only then display them?
I so thought I had this down and I was getting excited, but when I ran it, it didn't work. I've tried a few different things and I can't get it to work (not smart enough I guess). Code:
I need to find out if "fldValPaid" hold anything. I will use it an IF ELSE statement. In payment table a particular record could exist or not. How do I find out by evaluating "fldValPaid" if any record exists or not. I have to find out using "fldValPaid" ...I can not use number of record/record return or any other method.
I've been searching for an answer to this for quite some time now and have found nothing, so maybe (hopefully) someone out there will be able to help me.
At my work, we have a lot of folders for different jobs we've done. And right now, we have more than one person making the folders for all the new jobs that we get. I am trying to make a database were it will only show the jobs that have not had folders made. In order to do this, I've created a field titled "Initials". I want the webpage to pull up all the records where the Initials field is empty, but I'm having trouble doing that. I've tried a few different things and have found no success.
I'm not having a problem accesses the database or updating it, just displaying the right information. I'll give a little illustration (because I'm never good with words):
Say I have 3 jobs: Job #1, Job #2, and Job #3. Someone has already made job folders for Job #1, but Job #2 and Job #3 still need to be made. Since Job #1 has been made, that means there are initials in the initials field of the database and thus, I do not want that Job being displayed on the "To Be Made" page. Job #2 and Job #3 do not have initials in the initials field and as such, I want to display those jobs....
I have an index.asp page that displays my database items, along with their respective categories. The categories are an include page (left.asp). How can I hide the category if there aren't any items for that category? Here are the 2 pages below....
So I have a layer with a repeating table displaying the results of a recordset that are associated with the record being displayed behind the layer in a table. The problem is when there is no record to display it looks weird there. I'm trying to get it so that when that recordset is empty it puts an alternate text in that spot saying no records were found. I tried to get it done by throwing a layer on top of the existing layer whenever the recordset is null. The problem is the code I'm doing it with won't let me have quote marks, which are required for anything more complicated than basic text. Anyone have suggestions? Here is the code I'm using: ...
I have a Fedora Core 4 server with cPanel which is my master server shall I say. And 2 days ago, cPanel did an update which brutally murdered my MySQL 4.0.25 on the system, so I was forced to upgrade to 4.1.18. So we did that, and all is working now...
Now, my business has satelite servers that revolve around the master server. It allows people to remotely start and stop services on those satelites, and it uses ASP to remotely connect from the satelite, to the MySQL database on the master server to retrieve information regarding the users.
So yesterday, after the upgrade, my satelites seemingly connect to the MySQL server (it does not give an error), but it does not perform a correct query, thus no users on the network can start or stop their services. It just says "Invalid user or server". Now, the MySQL connection is working, because I have other software that authenticates thru the Master Server MySQL database that is working perfectly... I just think it is something wrong with the code on this Activ Serv... I had the program custom written about 2 years ago..
I have tried upgrading the MyODBC driver from 3.51.10 to 3.51.12 and that did nothing to help.
I have the entire code which is right here. Of course it uses a executable on the server to start/stop services and collect process ID information. But the queries are not working correctly so the executable never even runs... Code:
I've got a query that works fine when used in mySQL but completely fails when I try to apply it to MS Access, weird thing is that it is just a copy of a stored procedure that works fine in the same copy (with the Request.QueryString replaced by a fixed value) ! Any explaination would be great, ID is a number BTW :
SELECT page_title,ID,page_content FROM content WHERE ID='" & Request.QueryString("ID") & "' '
Had a look at aspfaq.com but couldn't find anything that applys.
I've got a SQL server database, and am using ASP to create a simple recordset.
Everything is fine, except that one column of the database is of 'text' data type. I can't seem to be able to pull anything from this field in my ASP script. All names and variables are correct, and there is data in the text field, it just comes out blank when I pull this field into my recordset.
The code below is a bit more representative of what I'm doing:
<!--#INCLUDE FILE="Database_Open.asp"--> <% sql ="SELECT * FROM CustomerBase WHERE " & _ "UserName='" & username & "' AND " & _ "SECRETWORD='" & password & "' "
RS.Open Sql, Connection, 3
IF RS.EOF THEN 'redirect code here ELSE RS.Fields("Fullname").value = "Bob" RS.Update %><!--#INCLUDE FILE="Database_Close.asp"--><% Response.Redirect ("Menu_Account.asp") END IF %>
in mysql i have a float field for bonus points, wich work as currency. ie 5.12 bonus points = 5.12 discount i have had the value of 5.12 in the points, and then used 5.12 bonuspoints however when it has been taken away i am left with this:
-1.14441e-007
as the value in bonuspoints here is mysql
"UPDATE customers SET bonusPoints=bonusPoints-" &pBonusPoints
I'm creating a database search page and the table I want to search has fields linked to other tables in the database. For example, the job table has a number of fields, 2 of which are area and job type which are tables in the database. My search page has option for searching by job title, job type and job area (via dynamic drop-down).
Do I need to create a recordset for each referenced for the dynamic drop-downs to work?
Ok so after ironing the bumps out of connecting to my MySQL database in ASP, I now want to run a query. So far it's working perfectly, BUT, it only returns with one result. Code:
Has anyone else found a memory leak using ADO streams to access binary data held in a database. I have searched through this forum and have not come across anyone else, so maybe it is just me.
The scenario is as follows: Windows 2000 SP3 MDAC 2.7 SP1 IIS5 MySQL 3.23 MyODBC 2.50
If I query the database and do a response.binarywrite everything works fine and no memory leak. eg. response.binarywrite myrecordset("blobfield")
If I read the very same BLOB field into a ADOstream I then get a memory leak in DLLHOST.EXE of how big that binary field was. ie If the picture is 140k in size DLLHOST.EXE increases its memory size by 140k.
This keeps on happening until DLLHOST.EXE is something like 250 MBytes in size at which point it stops working. Quick restart of the IIS Web service and I get all my memory back.
The command I am using to get the data into the ADOstream is picturestream.write myrecordset("blobfield")
I have also tried putting the binary data into a variable first before inserting it into the stream: set x=myrecordset("blobfield") picturestream.write x
The stream is closed and set to nothing at the end of processing. Everything is cleanly shut down. Through testing I know the memory leak occurs once the data has been written into the stream. The stream is correctly created as type binary.
The stream problem I am encountering does not seem to be limited to ASP, I tried it using Visual Basic to create a COM component to do the same job and still got a memory leak.
So the questions are: 1. Has anyone come across this before or fixed it? 2. Is there another way of getting binary data out of MySQL, something like the opposite of LoadFile?
I have wasted so much time on this problem but cannot find, having searched Microsoft's knowledge base and the rest of the web, any reference to the problem.
I have an Access database with 58 fields in one table. I wrote many of the field names so that they were descriptive so that others could figure it out in the future. As an example, one field name is called MissingPart14990aDescribe.
Should I be worried about the length of the field name? I'm expecting about 20,000 records a year to be entered into the database. So, five years from now, which would be about 100,000 records, will the query.asp for a list of records be slow due to field name size? BTW, the query.asp would just show a list of the last 3 months worth of records and only a snapshot of about 6 of the 58 fields.
I'm trying to retrieve data on all users currently within our active directory system, and although i have had some success there is one field that i still can't extract the values from - postalAddress. I'm using the following code:
at one page it works fine and when i use the same kind of code to update another TEXT field it doesn't update and the I.E. loading bar increases very slowly and the next page never loads someone suggested to use .appendchunk i used rs.appendchunk and i got the error "object doesn't support this property or method" he also said that .appendchunk cannot be used to update nvarchar.
i removed the code to update TEXT field and the page loaded as expected (normally)! Why one text field worked fine while the other didn't?
i have a table in which i have many text boxes, they are named as a1,a2,a3,a4 to a16 the next row is b1,b2,b3 to b16 and so on up to G1,G2 etc, where the user enters his data, what i want to do is only allow the user to enter numbers, which can have decimals if required,
how can this be done, also i have another set of textboxes through which i want to loop and prevent user the user from entering the same data in more then one box how can this be done any help will be appreciated thank you.these are the text boxes a1,b1,c1,d1,e1 etc which is actually the first column in the table.