Re: Data Shaping in VB6



Val

Hi - thanks for the follow-up

I've got several - the following is typical. In this example lngUpdateID is
a long parameter passed to the procedure. It should produce a report
combining a single work record with child records being one or more items of
equipment used on the job.

Set ShpData = New ADODB.Connection
ShpData.Provider = "MSDataShape"
ShpData.Open GetShapeConnection(DBtype)

Set rsRec = New ADODB.Recordset

rsRec.Open "SHAPE {select * from tblWorkUpdates " & _
"WHERE UpdateID = " & lngUpdateID & "} AS WRupdates " & _
"APPEND ({select * from qryEquipmentOnJob} AS Equip " & _
"RELATE UpdateID TO JobUpdateID) AS Equip", ShpData

GetShapeConnection is a public function as follows, to save me having to
enter all this code each time I use Shapes.

Public Function GetShapeConnection(iDBtype As Integer)
' return a connection string to open a shaped recordset
Dim sConn As String
Select Case iDBtype
Case access
sConn = "Data Provider = Microsoft.Jet.OLEDB.4.0; " & _
"Data Source=" & Path & "; " & _
"Persist Security Info=False; " & _
"JET OLEDB:Database Password=" & Password
Case sqlserver
sConn = "Data Provider=SQLOLEDB;" & _
"password=" & Password & ";" & _
"servername=" & ServerName & ";" & _
"user ID=" & UserName & ";" & _
"Initial Catalog=" & ServiceName
End Select
GetShapeConnection = sConn
End Function

As I said, it's fine with a combo of XP+Access, or XP+SQL Server, or
NT+Access. NT+SQL Server is the only combination which fails.

--
Marco


"Val Mazur (MVP)" wrote:

> Hi,
>
> What is your connection string that fails?
>
> --
> Val Mazur
> Microsoft MVP
>
> http://xport.mvps.org
>
>
>
> "MarcoPolo" <MarcoPolo@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:A9D2DBB6-C29C-4D95-8D62-F83623BFC60B@xxxxxxxxxxxxxxxx
> >I have a report using a shape command. It works fine with a SQL Server
> > database under XP, or with an Access database under XP or NT. When I try
> > to
> > run it on SQL Server under NT I get the error "Invalid connection string
> > attribute". I assume I must be missing something in terms of providers,
> > but
> > I'm grasping at straws.
> >
> > The connection to the SQL Server database under NT is fine - non-Shape
> > commands execute as expected.
> > --
> > Marco
>
>
>
.



Relevant Pages

  • connect to Access DB via IP address
    ... Like SQL Server, is it possible to build the connection string using IP ... address for retrieving data from Access DB? ... of using VPN is the only solution to connect Access database in data center. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: ADO.NET security in Windows App?
    ... my MSDN search provides a bunch of information not relevant to my ... > connection string as well as all data you send between client/server. ... >> with both a MS Access database and an MS SQL Server 2000 database. ...
    (microsoft.public.dotnet.security)
  • Help! Microsoft Access 2003 issue with linked tables.
    ... I have a Microsoft Access database and tables are linked to the SQL Server ... I use that SQL user in my connection string, ...
    (microsoft.public.access.security)
  • DataView with Microsoft Access
    ... I can insert a dataview and configure SQL Server with no problems, ... The access Database is on the server, ... The connection string I am using is: ...
    (microsoft.public.sharepoint.windowsservices)
  • RE: How do I configure Analysis Services for Excel 2003 users?
    ... they had had Office 2003 installed AFTER SQL Server. ... > I have been preparing a set of cubes in Analysis Services 2005 to be viewed ... > Excel reports have been designed as pivot tables based on AS cubes, ... > Surely it must be that the connection string is incorrect but I seem to have ...
    (microsoft.public.sqlserver.olap)