Wrox Programmer Forums
|
VB Databases Basics Beginning-level VB coding questions specific to using VB with databases. Issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB Databases Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 31st, 2006, 07:41 PM
Authorized User
 
Join Date: Dec 2005
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to ggiibboo
Default Query on the wrong data type

This problem is Bugging the hell out of me

I am wanting to perform some searches and apply some filters etc to my database however I keep incurring the same problem. The problem is that when I run queries on the data, the query engine doesn't recognise "CAU21" to sort by or filter by, it only can perform the sorting via the IDnumber that is associated with "CAU21" in the Lookup-RelayType table.

I hope I am making sense.

I will give you a breif example to explain.

My main table looks something like this:

ID Plant Area RelayType Datasheet1 SerialNumber
7 1 2 2 CDAG51 RP34288
8 1 2 4 VAF RP34296
9 1 2 2 CDAG51 RP34290
10 1 2 4 VAF RP34297
11 1 2 5 CDG11 RP34285
12 1 2 2 CDAG51 RP34286
13 1 2 6 CAG14 RP34292
14 1 2 4 VAF RP34294
15 1 2 2 CDAG51 RP34291
16 1 2 4 VAF RP34295
17 1 2 3 MUL269
18 1 2 3 MUL269
19 1 2 3 MUL269
20 1 2 3 MUL269
21 1 2 3 MUL269
22 1 2 2 CDAG51 RP34287
23 1 2 7 VAA RP34293
24 1 2 2 CDAG51 RP34289
25 1 2 6 CAG14 RP35023
27 2 3 22 149546
28 2 3 22 149616
29 2 3 22 149627
30 2 3 22 149536
32 2 3 8 CAG14 RP71463
33 2 3 9 CAU21 RP71382
34 2 4 23 91494
35 2 4 8 CAG14 RP22013
36 2 4 23 91501
37 2 4 11 043849J
38 2 4 12
39 2 4 3
40 2 4 3
41 2 5 22 149619

And then one of the lookup tables (Lookup-RelayType for an example) looks like this:


ID RelayType
2 CDAG51
3 Multilin 269Plus
4 VAA31/VAF
5 CDG31
6 CAG14/CAA
7 VAA11
8 CAG14
9 CAU21
10 Thermal O/L
11 MVAG
12 Multilin SR735
13 VAG11
14 CDG64
15 VAG51
16 DTH
17 VAA51
18 CDG11
19 CDG54
20 CAG13
21 MCAG
22 5A/R/95
23 M5A


So when I want to perform a search on all the CAU21 type relays (CAU21 has ID 9) I have to do a search on "9" or a filter/sort on "9". This is far from practicle because the end user doesn't know what the "ID" is of the particular type that they want to look up, and even if they did, it doesn't make sense to filter using "9" in order to get all the CAU21 relay information being displayed.


Any suggestions?


Mike

 
Old January 31st, 2006, 07:44 PM
Authorized User
 
Join Date: Dec 2005
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to ggiibboo
Default

after posting this the "main table" is a bit misleading. the Datasheet 1 and SerialNumber columns are text strings, whilst the other columns are all just ID numbers associated with other tables (the tabulating on this forum doesn't look after the table to keep it as it was when i posted it)






Similar Threads
Thread Thread Starter Forum Replies Last Post
Arguments are of the wrong type, are out of accep jenpitts ASP.NET 2.0 Basics 3 August 14th, 2007 03:00 PM
Arguments are of the wrong type???? Seb_soum Classic ASP Databases 12 November 9th, 2006 02:20 PM
CreateParameter - wrong type rit01 Classic ASP Databases 2 February 2nd, 2006 08:39 PM
What`s wrong with Query??? :( Varg_88 Classic ASP Basics 8 January 18th, 2005 09:41 AM
Query yes/no data type ajb963 Access 3 June 18th, 2004 03:05 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.