View Single Post
  #1 (permalink)  
Old May 20th, 2004, 04:36 AM
MoyesBlue MoyesBlue is offline
Registered User
Join Date: May 2004
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Addling table links from VB


I have a report that I access through RDC

At runtime, I add a temp SQL server view to the report

That works fine

I then try and add a link from the newly added table to an existing table on
report and get the following error

WArning - Fields in the report from the file """ cannot be linked

If I add the view in manaually in Crystal then the view and the table link

This is my VB code

Set mobjApplication = New CRAXDDRT.Application
mobjApplication.LogOnServer "PDSODBC.DLL", "VtsMain", "VtsMain", "sa",
subGroupChooseReport ' open selected report

X.ActiveConnection = "Provider=MSDASQL.1;Persist SecurityInfo=False;User
ID=sa;pwd=xxxx;Data Source=VTSMain"
X.Open ("Select * from tester")
'add view to report
mobjreport.Database.AddADOCommand X.ActiveConnection, X.ActiveCommand

Set tab1 = mobjreport.Database.Tables(1) ' table i want to link to
Set tab2 = mobjreport.Database.Tables(11) ' 11 being the new view added to
Debug.Print mobjreport.Database.Links.Count

'attempt to add link
mobjreport.Database.Links.Add tab2, tab1, 30, 1, crJTEqual,
crLTLookupProduct, False, 1