Help on using Shape
From: Peter (anonymous_at_discussions.microsoft.com)
Date: 06/04/04
- Previous message: ricky: "crystal report-subreport shows "file not found""
- Next in thread: Don Hanfland: "Re: Help on using Shape"
- Reply: Don Hanfland: "Re: Help on using Shape"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 4 Jun 2004 00:41:06 -0700
I used the vbDataform Wizard to create a Master detail from. The form desplays fine, however, im trying to refine it slightly. This form is part of a project that already has a 'trusted connection ' to a SQL server, and rather that make a new connection ech time this form is used, i'd like to use the current connection. Ive managed it fine with all my other forms, its only the ones using the Hsape command that seem to cause the problem. The Global connection to the SQL Server is calle 'Userdbconnect' current code for the master detail form ;
Private Sub Form_Load()
Dim db As Connection
Set db = New Connection
db.CursorLocation = adUseClient
db.Open "PROVIDER=MSDataShape;Data PROVIDER=MSDASQL;dsn=" & pParmString(0) & ";uid=" & pParmString(2) & ";pwd=" & pParmString(3) & ";database=BossData;"
Set adoPrimaryRS = New Recordset
adoPrimaryRS.Open "SHAPE {select tblOA_Licence ,tblOA_AccountID,tblOA_BACSID,tblOA_SortCode,tblOA_AccountNumber,tblOA_AccountName,tblOA_Country from OriginatingAccounts Where tblOA_Licence = '" & pOrigLicence & "' Order by tblOA_Licence} AS ParentCMD APPEND ({select tblOA_Licence,tblOA_AccountID,tblOA_BACSID,tblOA_SortCode,tblOA_AccountNumber,tblOA_AccountName,tblOA_Country from OriginatingAccounts Order by tblOA_Licence } AS ChildCMD RELATE tblOA_Licence TO tblOA_Licence) AS ChildCMD", db, adOpenStatic, adLockOptimistic
When i change the adoPrimaryRS.open line to use UserdbConnect instead of db i get the following error ;
Runtime Error '-2147217900'
Syntax error or access violation
Can any one help ?
- Previous message: ricky: "crystal report-subreport shows "file not found""
- Next in thread: Don Hanfland: "Re: Help on using Shape"
- Reply: Don Hanfland: "Re: Help on using Shape"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|