Solved

Using Forms with ASP/ADO/VBScript

Posted on 1999-01-23
3
148 Views
Last Modified: 2013-12-25
I have an Access database with 1 table. Most Items within the table are text with the exception of 2 items that are Integers. The form, of course, has fields contained with the database. 2 of the fields that are Integer types within the database are defined in HTML like all other fields (Input type=text...). Here is my problem: if the fields that are of the type integer have not been filled in upon submitting the form, I get "type mismatch" error. If the fields have info everything is fine. Also, I do not require the fields to be filled. I also understand the the Val function in VBScript does not work correctly.
Please help!
0
Comment
Question by:vmorales
  • 2
3 Comments
 
LVL 10

Accepted Solution

by:
MasseyM earned 70 total points
ID: 1859164
Do a check before posting to the database.

PostNumber1=Request("TheField")
If PostNumber1 = "" then PostNumber1 = "0"
Rs("TAbleField1") = PostNumber1

Just check to make sure it has a value.

If you need more help, please email me at masseym@mrqcorp.com nd include the database and all ASP pages.

0
 

Author Comment

by:vmorales
ID: 1859165
Thanks MasseyM,

That was a simple solution. I suppose I made the problem more complex than it was.
By the way, I work for a financial institution and wear many hats. I noticed that you have started your own company. I would be interested in so material/information about your company. We will be in the near future look into offering Internet services. At this time I am working on a intranet project. I will email you with an address to sent info to. Again, thanks.
0
 
LVL 10

Expert Comment

by:MasseyM
ID: 1859166
That sounds very good.  YOu can email me at masseym@mrqcorp.com.  I am still in the process of coming up with "material" to send, but will have it within the next two-three days.  I will await your email.

Thanks,

Matt
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
FAQ pages provide a simple way for you to supply and for customers to find answers to the most common questions about your company. Here are six reasons why your company website should have a FAQ page
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question