From: Geoff Chambers on
I have an SQL Express database that I'm trying to link/join with a
Sybase database. I have a table in a browse window with a column
vendorid. I would like to link to the master table vendors and add the
column vendor name from the table of vendors. Since there are 2
diferent database, I have 2 Connections. Any ideas? I should also note
that I'm using Classmate.

From: Ginny Caughey on
Geoff,

Are you using VO2Ado with the Classmate extensions - cmAdoServer class? If
so, you can write your own FieldGet methods for subclasses that do whatever
you want. Here's one of mine, where CSIAdoServer inherits from cmAdoServer:

ACCESS LastPayAmt CLASS CSICustomerServer
LOCAL oHistory AS CSIAdoServer
LOCAL cCustnum AS STRING
LOCAL amount AS FLOAT
cCustnum := NTrim(SELF:FieldGetSym(#custnum))
oHistory := CSIAdoServer{;
"select top 1 dollars from history "+ ;
" where custnum = "+ ;
"'"+cCustnum+"'"+ ;
" and recordflag = 'P' order by datein desc", ;
SELF:Connection}
amount := oHistory:FIELDGET(1)
oHistory:Close()
RETURN amount

You'd just use the other connection instead of the same connection to look
up the data you need. Then you can treat this calculated field just like any
other field name.

--
Ginny


"Geoff Chambers" <gchambers02(a)msn.com> wrote in message
news:1160578019.564878.299670(a)e3g2000cwe.googlegroups.com...
>I have an SQL Express database that I'm trying to link/join with a
> Sybase database. I have a table in a browse window with a column
> vendorid. I would like to link to the master table vendors and add the
> column vendor name from the table of vendors. Since there are 2
> diferent database, I have 2 Connections. Any ideas? I should also note
> that I'm using Classmate.
>


From: Geoff on
Geoff,

This is just a standard relation and is easily possible with VO2Ado (as
Ginny says). All you do is use SetRelation in the normal way. A lookup
is performed for every rows however so be prepared for this.

Geoff



"Geoff Chambers" <gchambers02(a)msn.com> wrote in message
news:1160578019.564878.299670(a)e3g2000cwe.googlegroups.com:

> I have an SQL Express database that I'm trying to link/join with a
> Sybase database. I have a table in a browse window with a column
> vendorid. I would like to link to the master table vendors and add the
> column vendor name from the table of vendors. Since there are 2
> diferent database, I have 2 Connections. Any ideas? I should also note
> that I'm using Classmate.

From: richard.townsendrose on
Geoff,

What I want to know is why SQL is so slow on lookups etc. and why
"joins" are reported as not to be a good idea.

SQL is supposed to be superior to ADS .... but really is it ????

Richard

From: Geoff on
Richard.

SQL is not slow on lookups - where is your evidence for this <g>.

Mind you, I can SQL go slow but I can make DBF go slow too - just a
apply a big filter!

Secondly, SQL is superior to ADS for an SQL engine as opposed to a DBF
engine. But that much is obvious - what is less obvious would be the
comparison between ADS SQL and MS SQL, for instance. The only thing I'd
say here is that MS SQL is potentially cheaper TCO wise than MS SQL (at
all scales) and MS is used by vastly more people. However it is equally
true to say that most ADS enthusiasts are quite happy with ADS. So too
are MySQL users <g>. ADS do give good support.

Now, joins ARE a good idea - I am not sure where you get your counter
advice from. Like anything in SQL they have to be done properly but it
is the concept of a join that gives you the most important benefit over
a DBF. Infinite and (usually) instant relations at runtime. A DBF
requires you to plan relations around known indexes and to change one
requires you to change code and change indexes.

"richard.townsendrose(a)googlemail.com"
<richard.townsendrose(a)googlemail.com> wrote in message
news:1160639833.585275.97300(a)i3g2000cwc.googlegroups.com:

> Geoff,
>
> What I want to know is why SQL is so slow on lookups etc. and why
> "joins" are reported as not to be a good idea.
>
> SQL is supposed to be superior to ADS .... but really is it ????
>
> Richard