ADO Filter on Integer fields(values) [Edit]

Hello
I need a little help on setting a filter on an Integer field
i use adotable linked access database 

String fields are no problem, but I just can't seem to get an Integer to work correctly.
the problem is:  the type of filter is string 
i use this code 
-------------------------------------------------------------------------------------------------------------------------
if edit1.Text <>'' then
begin
ADOTable1.Filter :='id like '+ quotedstr(edit1.Text +'*');
ADOTable1.Filtered :=true;
end
else
ADOTable1.Filtered :=false;
------------------------------------------------------------------------------------------------------------------------

Experimented with the use of  QuotedStr(IntToSTr(edit1.Text +'*'));   but do not Succeed 

this is my projet to download
http://www.mediafire.com/?sm13ba9g8ifm3bm

Edited by: unja unja on Jun 24, 2013 8:57 AM
0
unja
6/24/2013 3:57:56 PM
embarcadero.delphi.database 1294 articles. 0 followers. Follow

2 Replies
1971 Views

Similar Articles

[PageSpeed] 23

unja unja wrote:
> Hello
> I need a little help on setting a filter on an Integer field
> i use adotable linked access database 
> 
> String fields are no problem, but I just can't seem to get an Integer to work correctly.
> the problem is:  the type of filter is string 
> i use this code 
> -------------------------------------------------------------------------------------------------------------------------
> if edit1.Text <>'' then
> begin
> ADOTable1.Filter :='id like '+ quotedstr(edit1.Text +'*');
> ADOTable1.Filtered :=true;
> end
> else
> ADOTable1.Filtered :=false;
> ------------------------------------------------------------------------------------------------------------------------
> 
> Experimented with the use of  QuotedStr(IntToSTr(edit1.Text +'*'));   but do not Succeed 
> 
> this is my projet to download
> http://www.mediafire.com/?sm13ba9g8ifm3bm
> 
> Edited by: unja unja on Jun 24, 2013 8:57 AM

'Like' makes no sense for integers.  Try

ADOTable1.Filter := 'id = '+ edit1.Text;

You might want to try calling TryStrToInt to make sure the edit box does indeed 
contain a number first.

-- 
Jeff Overcash (TeamB)
       (Please do not email me directly unless  asked. Thank You)
And so I patrol in the valley of the shadow of the tricolor
I must fear evil. For I am but mortal and mortals can only die.
Asking questions, pleading answers from the nameless
faceless watchers that stalk the carpeted  corridors of Whitehall.
              (Fish)
0
Jeff
6/24/2013 4:20:56 PM
thanks it is work

> {quote:title=unja unja wrote:}{quote}
> Hello
> I need a little help on setting a filter on an Integer field
> i use adotable linked access database 
> 
> String fields are no problem, but I just can't seem to get an Integer to work correctly.
> the problem is:  the type of filter is string 
> i use this code 
> -------------------------------------------------------------------------------------------------------------------------
> if edit1.Text <>'' then
> begin
> ADOTable1.Filter :='id like '+ quotedstr(edit1.Text +'*');
> ADOTable1.Filtered :=true;
> end
> else
> ADOTable1.Filtered :=false;
> ------------------------------------------------------------------------------------------------------------------------
> 
> Experimented with the use of  QuotedStr(IntToSTr(edit1.Text +'*'));   but do not Succeed 
> 
> this is my projet to download
> http://www.mediafire.com/?sm13ba9g8ifm3bm
> 
> Edited by: unja unja on Jun 24, 2013 8:57 AM
0
unja
6/24/2013 4:56:00 PM
Reply:

Similar Artilces:

updating database on edit page after edit values in textbox field
Hi all I am having a view page with feilds like userid, username, email,and etc.....All controls are Textboxes.....All controls are disabled at view page...Data comes from database, on the bases of userlogin details...User can only view the filled by him/her during registration....I have one LinkButtion named "Edit Profile" on view page....As user clicked to Edit Profile...all controls get enabled except userid...now as user edit the details and click on save button data should get updated in the database with resoect to userid....And the problem is update query not gett...

Edit a Database Field when Checkboxed Value on Submit Click
 Hi,  I am new to VWD and VB, and I have been racking my brain for weeks on how to do this.  My main problem is I don't even know what I am looking for.  Am I looking for a VB script?  ASP script VB code?  No clue!  Anyway, here is my question.  The ASP page below displays a GridView with a custom column I made for a checkbox.  When the submit button is clicked it runs the script at the top of the code and iterates through each row (or so I think) and checks for a checked box then, on line 20 I would like to update the Runner field of the selecte...

Drop down list in Form view returns error when value in bound field (data binding
I get the following error when I click edit to edit the details in the web form:'ddlUserRestrictionType' has a SelectedValue which is invalid because it does not exist in the list of items.Parameter name: value  I would like it to accept any value which currently exists in the database. Is this easily achievable? With what you've posted, all I can tell is that you are trying to set the SelectedValue of a ddl to a value that does not exist in the list.  It would be helpful if you can post some code and the expected values of this control.~ Timwww.bucketo...

Problem in extracting null value from a grid view field to add to a database table field
Hi,I have a grid view and I am extracting a field value from the gridview corresponding to the chosen record via a radio button. Now for a particular record the field in grid view in asp.net is showing null value (blank). However when I am extracting this field value to add it to a database table the field in the table is populated by "&nbsp". I would like the field to be populated with null or even "". I am not sure how to do this. The following approach is failing:            If SelectedGridRow.Cells(5).Text = &qu...

Trying to edit web form, can't get database updated with newly edited values.
 This is my code:  when I try to update any of the fields, the update statement retains the old values retrieved from the database.  Could you tell me where my code is bad? -Thanks, Mark   <%@ Page Language="VB" %><%@Import Namespace="System.Data"%><%@Import Namespace="System.Data.SqlClient"%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><script runat="server"> Protected Sub Page_Load(ByVa...

Error "Multiple-step operation generated errors. Check each status value setting datetime field value" with TADOQuery and TDateTime (Delphi XE2)
Hello all, I've created an application which should do some automated tasks. When I run the application normally (as admin on a Window Server 2008 R2 x64 + MSSQL Server 2008 R2) everything works just fine. But whe I run the application a a 'sceduled taks' (with a different Windows User account), I get the following error when I modify a datetime field of a SQL query and I try to post the record Multiple-step operation generated errors. Check each status value setting datetime field value This is what I do (not exact query...): procedure Edit(aConn: T...

Database default field values
Hi, how do I create  default values for the different fields within MySQL database when I first create the database? I've got an error message from VS2003 that basically said that the fields need deault values, when I run my code in the browser. Thank you in advance for your help. Hello my friend, Try the following command if the table already exists: - ALTER TABLE MyTable MODIFY MyColumn VARCHAR(250) NOT NULL DEFAULT 'Not specified' NOT NULL means a value must be given for the field.  If you do not supply one, it will be assigned 'Not specified'.  &nb...

Validate one datagrid edit field off another edit field
ok I have a dropdownlist if the user selects Item 3 then I want to show a requiredfieldvalidator for the datefield. see your previous post. I can provide you with some sample code doing not exactly that but using one control validation based on the value of the other one. Give me a shout if you are interested Cheers Bug [MCSD] i did not think the first one went through, thanks I will look...

testing the value of a database field
I am converting a site to asp.net and have run into the following problem.in ASP I used to text if a field from a database was empty with the following Set objConn1 = Server.CreateObject("ADODB.Connection") objConn1.ConnectionString = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & _  Server.MapPath("../e_courses.mdb") & ";"  objConn1.Open  Set objRS1 = Server.CreateObject("ADODB.Recordset")  strSQL1 = "SELECT * FROM RCe_courses WHERE ID =  "& searchid & ""  objRS1.CursorLocation = 3 objRS1.Open strSQL1, objConn1 &nbs...

getting value from database into integer
I have an sql statmetn that counts all the votes in the table. i need this to calculate the quota. My problem is how to i get the value(i.e the count of the votes) into the area thats colored red below? SqlCommand SqlCmd1 = new SqlCommand("SELECT count(vote)FROM PRTest", SqlCon1); int quota =  (count(Vote) + 1) / ((11) + 1); Response.Write(quota); You can use ExecuteScalar method.  Following is an example from the online documentation for SqlCommand.ExecuteScalar method:static public int AddProductCategory(string newName, string connString) { Int32 newProdID = 0; ...

Bugzilla
This is a multi-part message in MIME format. ------_=_NextPart_001_01CE7F16.270F8A7A Content-Type: text/plain; charset="iso-8859-1" content-transfer-encoding: quoted-printable Messrs By Administrator, on the "Field Values", "Status", I've added two options an= d these options do not appear Do you need any special treatment? Atte. Darlio Gonz=E1lez L. Fono: 26746763 Anexo: 6763. Hu=E9rfanos 1052, piso 10, Santiago Chile. CONFIDENCIALIDAD Y USO EXCLUSIVO: La informaci=F3n contenida en este mensaje= y/o en...

Lookup edited value of a field
Hi, I'm writing a simple business rule that checks if ClosedDt is priror to OpenDt like in the following code.partial void OnCLOSEDTChanging(DateTime? value) {if (value < this._OPENDT )throw new ValidationException("Closed Date cannot be prior to the Open Date"); } I want to reference the new changed value of the OpenDt field and not the value that it has prior to the edit. I have tried both this._OPENDT and this.OPENDT but they both reference the value prior to the edit.  Any ideas? If you want to check several value (new values) you will need to do this in ...

Edit mask in Integer Field
I'm trying to an edit mask in an integer field in a Sybase Database. I want to set the mask to ###,###,### . When I do this, I do not see any value in the field if the value is supposed to be "0" . I see all other values from 1 to 999,999,999 but not "0" ! If I set the mask to #########, it works fine! Anybody have any ideas what is going on here? Thanks in advance for the help. Gary H. > I'm trying to an edit mask in an integer field in a Sybase Database. I > want to set the mask to ###,###,### . When I do this, I do not see any > value...

how to filter duplicate field value
In Access and VFP,statement "select distinct fieldvalue from tablename",In PB,how to filter duplicate field value? TKS! Exactly the same way in SQL syntax eg SELECT DISTINCT staff_ref FROM Transactions The DISTINCT key word will filter the result set to remove duplicate entries. Beware using this to 'fix' badly constructed queries such as those giving the cartesian product of two or more tables. On Sat, 7 Jul 2001 10:29:44 +0800, in powersoft.public.powerbuilder.datawindow Kalmwu <kalmwu@163.com> wrote: >In Access and VFP,statement "se...

Web resources about - ADO Filter on Integer fields(values) [Edit] - embarcadero.delphi.database

Integer - Wikipedia, the free encyclopedia
) are formed by the natural numbers (including 0) ( 0 , 1 , 2 , 3 , ...) together with the negatives of the non-zero natural numbers ( −1 , −2, ...

Math Practice - Integers - Addition Subtraction Multiplication & Division on the App Store on iTunes
Get Math Practice - Integers - Addition Subtraction Multiplication & Division on the App Store. See screenshots and ratings, and read customer ...

Starbucks Taps Omnicom's Integer For Efforts Outside Its Stores
Omnicom Group's Integer Group has been added to the Starbucks roster after the coffee giant sought an agency for a big shopper-marketing push. ...

The New C: Integers in C99, Part 1 - Dr Dobb's December 2000/The New C
C has its roots in typeless languages, but it has come a long long way from its humble beginnings.

New MIT Debugger Checks for Integer Overflows
MIT's Directed Integer Overflow Detection (DIODE) debugger automatically finds integer overflows, which can potentially allow hacker attacks. ...

Gamasutra: Max Woolf's Blog - Diablo III Economy Broken by an Integer Overflow Bug
The following blog was, unless otherwise noted, independently written by a member of Gamasutra's game development community. The thoughts and ...

AWS EC2 C3/C4 Multicore Integer Performance Comparison
The C4 family, on average, had a 14 percent increase in integer performance over the C3 family. The c4.8xlarge VMs exhibited the largest performance ...


View Count for PSY’s ‘Gangnam Style’ Music Video Surpasses the 32-Bit Integer Max Value on YouTube
YouTube has upgraded their view count tracking after the music video for “Gangnam Style” by PSY surpassed the 32-bit integer max positive value ...

The saddest thing I know about integers
This is for math geeks and musicians. What really happens if you use a circle of fourths or fifths to tune an instrument?

Resources last updated: 1/18/2016 3:00:50 PM