HighDots Forums  

Need a query within the recordset

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss Need a query within the recordset in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Daniel_Cha
 
Posts: n/a

Default Need a query within the recordset - 11-11-2004 , 09:21 AM






DMX, WindowsXP

Here is what I am trying to do... I have a phone list of all our stores. It
contains managers home and cell numbers for emergencies. So the list is
about 44 stores and about 7 to 8 managers to each store...so that's about
350 or so numbers on this list... Now our store each have there own unique
IP address, ex. Store 2 would be 192.168.2.?? So within the phone list I
have, for each store I have stored the Ip like 192.168.2 or 192.168.6 and
so on.. Well what I want to do is try to build a query that will only return
records that are similar to the users IP... so I have a hidden request for
the IP... Request.ServerVariables("REMOTE_ADDR") which I want to use as a
variable in my query to compare their ip with what's in the table..

So the results would be like this...

My IP 192.168.6.15
I should see ONLY records with 192.168.6 as part of the IP.

Any suggestions? Ideas? not sure if this would be the place to post this,
but would appreciate any help.



Reply With Quote
  #2  
Old   
towcan's
 
Posts: n/a

Default Re: Need a query within the recordset - 11-11-2004 , 10:55 AM






Hi yea,
you will find that some isp's give a different IP address every time you
connect to the internet.
this is most common in the UK as otherwise one has to pay for a static IP
address.

Twocan's




"Daniel_Cha" <dan_cha (AT) hotmail (DOT) com> wrote

Quote:
DMX, WindowsXP

Here is what I am trying to do... I have a phone list of all our stores.
It
contains managers home and cell numbers for emergencies. So the list is
about 44 stores and about 7 to 8 managers to each store...so that's about
350 or so numbers on this list... Now our store each have there own unique
IP address, ex. Store 2 would be 192.168.2.?? So within the phone list I
have, for each store I have stored the Ip like 192.168.2 or 192.168.6 and
so on.. Well what I want to do is try to build a query that will only
return
records that are similar to the users IP... so I have a hidden request for
the IP... Request.ServerVariables("REMOTE_ADDR") which I want to use as a
variable in my query to compare their ip with what's in the table..

So the results would be like this...

My IP 192.168.6.15
I should see ONLY records with 192.168.6 as part of the IP.

Any suggestions? Ideas? not sure if this would be the place to post this,
but would appreciate any help.





Reply With Quote
  #3  
Old   
Daniel_Cha
 
Posts: n/a

Default Re: Need a query within the recordset - 11-11-2004 , 10:59 AM



This is internal to the company... so every store we have has its own set
internally...

So each store has 192.168.2.?? for each of there pc's
And the next store has its own 192.168.10.??
So our internal IP's do not change.. they are all static, except for a our
corporate location, which uses... DHCP.


"towcan's" <fouracc (AT) hotmail (DOT) com> wrote

Quote:
Hi yea,
you will find that some isp's give a different IP address every time you
connect to the internet.
this is most common in the UK as otherwise one has to pay for a static IP
address.

Twocan's




"Daniel_Cha" <dan_cha (AT) hotmail (DOT) com> wrote in message
news:cmvsi3$8h1$1 (AT) forums (DOT) macromedia.com...
DMX, WindowsXP

Here is what I am trying to do... I have a phone list of all our stores.
It
contains managers home and cell numbers for emergencies. So the list is
about 44 stores and about 7 to 8 managers to each store...so that's
about
350 or so numbers on this list... Now our store each have there own
unique
IP address, ex. Store 2 would be 192.168.2.?? So within the phone list
I
have, for each store I have stored the Ip like 192.168.2 or 192.168.6
and
so on.. Well what I want to do is try to build a query that will only
return
records that are similar to the users IP... so I have a hidden request
for
the IP... Request.ServerVariables("REMOTE_ADDR") which I want to use as
a
variable in my query to compare their ip with what's in the table..

So the results would be like this...

My IP 192.168.6.15
I should see ONLY records with 192.168.6 as part of the IP.

Any suggestions? Ideas? not sure if this would be the place to post
this,
but would appreciate any help.







Reply With Quote
  #4  
Old   
CMBergin
 
Posts: n/a

Default Re: Need a query within the recordset - 11-11-2004 , 12:41 PM



IPTrimmed = Request.ServerVariables("REMOTE_ADDR")
IPTrimmed = LEFT(IPTrimmed, InStrRev(IPTrimmed,"."))
.....
yourRS.Source = "SELECT <fields> FROM <table> WHERE IP LIKE
'"&IPTrimmed&"%'"


"Daniel_Cha" <dan_cha (AT) hotmail (DOT) com> wrote

Quote:
DMX, WindowsXP

Here is what I am trying to do... I have a phone list of all our stores.
It
contains managers home and cell numbers for emergencies. So the list is
about 44 stores and about 7 to 8 managers to each store...so that's about
350 or so numbers on this list... Now our store each have there own unique
IP address, ex. Store 2 would be 192.168.2.?? So within the phone list I
have, for each store I have stored the Ip like 192.168.2 or 192.168.6 and
so on.. Well what I want to do is try to build a query that will only
return
records that are similar to the users IP... so I have a hidden request for
the IP... Request.ServerVariables("REMOTE_ADDR") which I want to use as a
variable in my query to compare their ip with what's in the table..

So the results would be like this...

My IP 192.168.6.15
I should see ONLY records with 192.168.6 as part of the IP.

Any suggestions? Ideas? not sure if this would be the place to post this,
but would appreciate any help.





Reply With Quote
  #5  
Old   
Daniel_Cha
 
Posts: n/a

Default Re: Need a query within the recordset - 11-11-2004 , 01:38 PM



ok, im just that blind... but what is IPTRIMMED

My variable name is varIP Run-Time Value is
Request.ServerVariables("REMOTE_ADDR")

My current sql statement is as follows:
SELECT *
FROM tbEmerStore, tbIpRange
WHERE tbEmerStore.Store = tbIpRange.StoreNum AND 'varIP' LIKE
tbIpRange.IpRange
ORDER BY Store

and my Recordset is called... rsTest
----------------------
So where am i suppose to place this bit of code?
IPTrimmed = LEFT(IPTrimmed, InStrRev(IPTrimmed,"."))

and is IPTrimmed the name of the variable?


"CMBergin" <NoHarvestForYou (AT) NoSpam (DOT) org> wrote

Quote:
IPTrimmed = Request.ServerVariables("REMOTE_ADDR")
IPTrimmed = LEFT(IPTrimmed, InStrRev(IPTrimmed,"."))
....
yourRS.Source = "SELECT <fields> FROM <table> WHERE IP LIKE
'"&IPTrimmed&"%'"


"Daniel_Cha" <dan_cha (AT) hotmail (DOT) com> wrote in message
news:cmvsi3$8h1$1 (AT) forums (DOT) macromedia.com...
DMX, WindowsXP

Here is what I am trying to do... I have a phone list of all our stores.
It
contains managers home and cell numbers for emergencies. So the list is
about 44 stores and about 7 to 8 managers to each store...so that's
about
350 or so numbers on this list... Now our store each have there own
unique
IP address, ex. Store 2 would be 192.168.2.?? So within the phone list
I
have, for each store I have stored the Ip like 192.168.2 or 192.168.6
and
so on.. Well what I want to do is try to build a query that will only
return
records that are similar to the users IP... so I have a hidden request
for
the IP... Request.ServerVariables("REMOTE_ADDR") which I want to use as
a
variable in my query to compare their ip with what's in the table..

So the results would be like this...

My IP 192.168.6.15
I should see ONLY records with 192.168.6 as part of the IP.

Any suggestions? Ideas? not sure if this would be the place to post
this,
but would appreciate any help.







Reply With Quote
  #6  
Old   
CMBergin
 
Posts: n/a

Default Re: Need a query within the recordset - 11-11-2004 , 04:15 PM



You'll have to place above the recordset in code view. IPTrimmed is a
variable. You can't manipulate variables very well from the recordset
dialog box. Use that variable to construct your recordset, as outlined, or
set your recordset parameter (manually, not through the dialog box) to be
equal to the variable IPTrimmed.
"Daniel_Cha" <dan_cha (AT) hotmail (DOT) com> wrote

Quote:
ok, im just that blind... but what is IPTRIMMED

My variable name is varIP Run-Time Value is
Request.ServerVariables("REMOTE_ADDR")

My current sql statement is as follows:
SELECT *
FROM tbEmerStore, tbIpRange
WHERE tbEmerStore.Store = tbIpRange.StoreNum AND 'varIP' LIKE
tbIpRange.IpRange
ORDER BY Store

and my Recordset is called... rsTest
----------------------
So where am i suppose to place this bit of code?
IPTrimmed = LEFT(IPTrimmed, InStrRev(IPTrimmed,"."))

and is IPTrimmed the name of the variable?


"CMBergin" <NoHarvestForYou (AT) NoSpam (DOT) org> wrote in message
news:cn087r$qtm$1 (AT) forums (DOT) macromedia.com...
IPTrimmed = Request.ServerVariables("REMOTE_ADDR")
IPTrimmed = LEFT(IPTrimmed, InStrRev(IPTrimmed,"."))
....
yourRS.Source = "SELECT <fields> FROM <table> WHERE IP LIKE
'"&IPTrimmed&"%'"


"Daniel_Cha" <dan_cha (AT) hotmail (DOT) com> wrote in message
news:cmvsi3$8h1$1 (AT) forums (DOT) macromedia.com...
DMX, WindowsXP

Here is what I am trying to do... I have a phone list of all our
stores.
It
contains managers home and cell numbers for emergencies. So the list
is
about 44 stores and about 7 to 8 managers to each store...so that's
about
350 or so numbers on this list... Now our store each have there own
unique
IP address, ex. Store 2 would be 192.168.2.?? So within the phone
list
I
have, for each store I have stored the Ip like 192.168.2 or 192.168.6
and
so on.. Well what I want to do is try to build a query that will only
return
records that are similar to the users IP... so I have a hidden request
for
the IP... Request.ServerVariables("REMOTE_ADDR") which I want to use
as
a
variable in my query to compare their ip with what's in the table..

So the results would be like this...

My IP 192.168.6.15
I should see ONLY records with 192.168.6 as part of the IP.

Any suggestions? Ideas? not sure if this would be the place to post
this,
but would appreciate any help.









Reply With Quote
Reply




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.