M
Mark
Hi,
I'm developing a VB6 application with a MS Access 2000 database (for
reporting purposes etc.) using an ODBC link. Some tables of it are linked
(another ODBC link) to a SQL Server 2005 database. I need to show some
records in my application coming from a MS Access query running on LINKED
tables (not imported tables) from the SQL database.
Problem: when I IMPORT the tables, recordset is complete, when I LINK the
tables, the recordset is empty (no records, only colum heads, no error
message). Probably this is caused by the differences in SQL syntax (thank
you Bill ;-)).
This is my query in Access:
SELECT
IIf([dbo_cicntp.cnt_email]="",LCase([dbo_cicmpy.cmp_e_mail]),LCase([dbo_cicntp.cnt_email]))
AS EMAIL, UCase(CStr([dbo_cicmpy.ID])) AS CODE, dbo_cicmpy.cmp_name AS
BEDRIJF, [cnt_l_name] & " " & [cnt_f_name] AS FAMILIENAAM, dbo_cicntp.Gender
AS MVJ,
IIf(UCase([dbo_cicntp.taalcode])="NL","NL",IIf(UCase([dbo_cicntp.taalcode])="FR","F","E"))
AS TAAL, IIf([dbo_cicntp].[active_y]=1,True,False) AS ACTIEF,
dbo_cicmpy.SubSector AS VESTIG, "CATEGORIE" AS CAT, dbo_cicntp.cnt_f_tel AS
TEL, Trim([dbo_cicmpy.cmp_fadd1] & " " & [dbo_cicmpy.cmp_fadd2] & " " &
[dbo_cicmpy.cmp_fadd3]) AS STRAAT, dbo_cicmpy.cmp_fpc AS POSTNR,
dbo_cicmpy.cmp_fcity AS GEMEENTE, dbo_cicmpy.cmp_fctry AS LAND, etc...
FROM (dbo_cicmpy INNER JOIN dbo_cicntp ON dbo_cicmpy.cnt_id =
dbo_cicntp.cnt_id) INNER JOIN dbo_pred ON dbo_cicntp.predcode =
dbo_pred.predcode
WHERE (((dbo_cicmpy.DivisionCreditorID) Is Null));
Is there any solution?
Could this be a solution: make an first query to the SQL database just to
gather the "clean" fields (I mean, without IIFs, Lcases, Ucases and other
functions unknown by SQL Server I use now) and then adapt my query here
above mentioned, and apply my IIF, Lcases and Ucases on the recordset
returned by my first query?
Thanks a lot for your time.
Mark
I'm developing a VB6 application with a MS Access 2000 database (for
reporting purposes etc.) using an ODBC link. Some tables of it are linked
(another ODBC link) to a SQL Server 2005 database. I need to show some
records in my application coming from a MS Access query running on LINKED
tables (not imported tables) from the SQL database.
Problem: when I IMPORT the tables, recordset is complete, when I LINK the
tables, the recordset is empty (no records, only colum heads, no error
message). Probably this is caused by the differences in SQL syntax (thank
you Bill ;-)).
This is my query in Access:
SELECT
IIf([dbo_cicntp.cnt_email]="",LCase([dbo_cicmpy.cmp_e_mail]),LCase([dbo_cicntp.cnt_email]))
AS EMAIL, UCase(CStr([dbo_cicmpy.ID])) AS CODE, dbo_cicmpy.cmp_name AS
BEDRIJF, [cnt_l_name] & " " & [cnt_f_name] AS FAMILIENAAM, dbo_cicntp.Gender
AS MVJ,
IIf(UCase([dbo_cicntp.taalcode])="NL","NL",IIf(UCase([dbo_cicntp.taalcode])="FR","F","E"))
AS TAAL, IIf([dbo_cicntp].[active_y]=1,True,False) AS ACTIEF,
dbo_cicmpy.SubSector AS VESTIG, "CATEGORIE" AS CAT, dbo_cicntp.cnt_f_tel AS
TEL, Trim([dbo_cicmpy.cmp_fadd1] & " " & [dbo_cicmpy.cmp_fadd2] & " " &
[dbo_cicmpy.cmp_fadd3]) AS STRAAT, dbo_cicmpy.cmp_fpc AS POSTNR,
dbo_cicmpy.cmp_fcity AS GEMEENTE, dbo_cicmpy.cmp_fctry AS LAND, etc...
FROM (dbo_cicmpy INNER JOIN dbo_cicntp ON dbo_cicmpy.cnt_id =
dbo_cicntp.cnt_id) INNER JOIN dbo_pred ON dbo_cicntp.predcode =
dbo_pred.predcode
WHERE (((dbo_cicmpy.DivisionCreditorID) Is Null));
Is there any solution?
Could this be a solution: make an first query to the SQL database just to
gather the "clean" fields (I mean, without IIFs, Lcases, Ucases and other
functions unknown by SQL Server I use now) and then adapt my query here
above mentioned, and apply my IIF, Lcases and Ucases on the recordset
returned by my first query?
Thanks a lot for your time.
Mark