PC Review


Reply
Thread Tools Rate Thread

Database Query problem

 
 
Mac@440th
Guest
Posts: n/a
 
      8th Feb 2007
I am currently using an Access database built entirely using FP
Database Wizard (version: FP 2003). I have created a page (Page2)
displaying data using the Insert --> Database --> Results
functionality. The custom query I'm using is:

SELECT * FROM UMD WHERE AFSC like '::PartAFSC::';

I also have a page (Page1) where a the user fills out a form with the
field 'PartAFSC'. When the form is submitted, I call an 'onSubmit'
script that concatenates an asterisk "*" to the PartAFSC field, thus
the user enters, for example, '037' and Page2 receives '037*'.
However, when the query on Page2 is committed, I get the message 'No
records found.' I know records do exists, as I can run the query
directly in Access using the following query:

SELECT * FROM UMD WHERE AFSC like '037*'

and get the data I need. I am obviously doing something wrong, but
can determine, what exactly, I is wrong. Any suggestions, ideas, etc.

Thanks in advance!

 
Reply With Quote
 
 
 
 
Thomas A. Rowe
Guest
Posts: n/a
 
      8th Feb 2007
Try:

SELECT * FROM UMD WHERE AFSC LIKE '%" & PartAFSC & "%'

And DO NOT add the * to the search string
--
==============================================
Thomas A. Rowe
Microsoft MVP - FrontPage

http://www.Ecom-Data.com
==============================================


"Mac@440th" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I am currently using an Access database built entirely using FP
> Database Wizard (version: FP 2003). I have created a page (Page2)
> displaying data using the Insert --> Database --> Results
> functionality. The custom query I'm using is:
>
> SELECT * FROM UMD WHERE AFSC like '::PartAFSC::';
>
> I also have a page (Page1) where a the user fills out a form with the
> field 'PartAFSC'. When the form is submitted, I call an 'onSubmit'
> script that concatenates an asterisk "*" to the PartAFSC field, thus
> the user enters, for example, '037' and Page2 receives '037*'.
> However, when the query on Page2 is committed, I get the message 'No
> records found.' I know records do exists, as I can run the query
> directly in Access using the following query:
>
> SELECT * FROM UMD WHERE AFSC like '037*'
>
> and get the data I need. I am obviously doing something wrong, but
> can determine, what exactly, I is wrong. Any suggestions, ideas, etc.
>
> Thanks in advance!
>



 
Reply With Quote
 
Jon Spivey
Guest
Posts: n/a
 
      8th Feb 2007
Hi,
You need to use % for like instead of * when you use Access on the web.
SELECT * FROM UMD WHERE AFSC like '037%'

Cheers,
Jon

"Mac@440th" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>I am currently using an Access database built entirely using FP
> Database Wizard (version: FP 2003). I have created a page (Page2)
> displaying data using the Insert --> Database --> Results
> functionality. The custom query I'm using is:
>
> SELECT * FROM UMD WHERE AFSC like '::PartAFSC::';
>
> I also have a page (Page1) where a the user fills out a form with the
> field 'PartAFSC'. When the form is submitted, I call an 'onSubmit'
> script that concatenates an asterisk "*" to the PartAFSC field, thus
> the user enters, for example, '037' and Page2 receives '037*'.
> However, when the query on Page2 is committed, I get the message 'No
> records found.' I know records do exists, as I can run the query
> directly in Access using the following query:
>
> SELECT * FROM UMD WHERE AFSC like '037*'
>
> and get the data I need. I am obviously doing something wrong, but
> can determine, what exactly, I is wrong. Any suggestions, ideas, etc.
>
> Thanks in advance!
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Text field database query problem mike@multiline.com.au Microsoft Excel Discussion 5 23rd May 2005 03:27 AM
query problem in database =?Utf-8?B?RWxvaXNlQ1lQ?= Microsoft Access Queries 2 8th Nov 2004 10:15 PM
Database Structure and problem with query =?Utf-8?B?RWRnYXIgVGhvZW1tZXM=?= Microsoft Access Database Table Design 1 15th Oct 2004 12:46 PM
Database design and query problem - help is aprreciated Jan Microsoft Access Queries 5 12th Oct 2004 07:14 PM
database query problem Holstein Microsoft Frontpage 6 5th Aug 2003 03:52 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:44 AM.