Problem opening a query in ACCESS through workgroup

Problem opening a query in ACCESS through workgroup

Post by Sher » Thu, 21 Nov 2002 22:43:13



i have a following connection string which is perfectly fine and i can
successfully access to the ACCESS database through workgroup
connection string.

"Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=C:\Shared\NetAccessDatabase\Net.mdb;user
id=SYSTM;Password=tmsa;Jet OLEDB:System
database=c:\Winnt\system32\system.mdw;"

once i have accessed to the ACCESS database i have following function
to open the recordset with  sSQL = "select IDSegment from
vtblDefaultSegment"

The code for query vtblDefaultSegment is as follows:

 SELECT [IDSegment]
FROM tblTMSGroups
WHERE GroupID=SYSTM;

and try to fill the DataSet..

Shared Function OpeniTMSDataset(ByRef rsRecordSet As DataSet, ByVal
sSQL As String, ByVal sConnectionString As String, Optional ByVal
iOpenOption As Integer = DBConst.tmsDBEdit) As Boolean

       Dim objDA As OleDb.OleDbDataAdapter
        On Error GoTo ERRORHANDLER

        objDA = New OleDb.OleDbDataAdapter(sSQL, sConnectionString)
        objDA.Fill(rsRecordSet)
        objDA = Nothing
        OpeniTMSDataset = True
        Exit Function

ERRORHANDLER:
        u_errMessage = Err.Description
    End Function

 when i do this i should get one record back but instead i get an
error message saying "No value given for one or more required
parameters"...I would really appreciate if some one could tell me what
i am doing wrong here...Seems like i can't open the query
vtblDefaultSegment in access through workgroup
connectionstring.....Thanks

 
 
 

Problem opening a query in ACCESS through workgroup

Post by David Hare-Scot » Fri, 22 Nov 2002 07:50:11



Quote:> i have a following connection string which is perfectly fine and i can
> successfully access to the ACCESS database through workgroup
> connection string.

> "Provider=Microsoft.Jet.OLEDB.4.0; Data
> Source=C:\Shared\NetAccessDatabase\Net.mdb;user
> id=SYSTM;Password=tmsa;Jet OLEDB:System
> database=c:\Winnt\system32\system.mdw;"

> once i have accessed to the ACCESS database i have following function
> to open the recordset with  sSQL = "select IDSegment from
> vtblDefaultSegment"

> The code for query vtblDefaultSegment is as follows:

>  SELECT [IDSegment]
> FROM tblTMSGroups
> WHERE GroupID=SYSTM;

> and try to fill the DataSet..

> Shared Function OpeniTMSDataset(ByRef rsRecordSet As DataSet, ByVal
> sSQL As String, ByVal sConnectionString As String, Optional ByVal
> iOpenOption As Integer = DBConst.tmsDBEdit) As Boolean

>        Dim objDA As OleDb.OleDbDataAdapter
>         On Error GoTo ERRORHANDLER

>         objDA = New OleDb.OleDbDataAdapter(sSQL, sConnectionString)
>         objDA.Fill(rsRecordSet)
>         objDA = Nothing
>         OpeniTMSDataset = True
>         Exit Function

> ERRORHANDLER:
>         u_errMessage = Err.Description
>     End Function

>  when i do this i should get one record back but instead i get an
> error message saying "No value given for one or more required
> parameters"...I would really appreciate if some one could tell me what
> i am doing wrong here...Seems like i can't open the query
> vtblDefaultSegment in access through workgroup
> connectionstring.....Thanks

What type of field is GroupID?
If it is numeric you will have to explicitly set the value of  SYSTM.
If it is text and SYSTM is a constant string value not a variable then
your syntax should be
SELECT [IDSegment] FROM tblTMSGroups WHERE GroupID='SYSTM';
If it is text and SYSTM is a variable you will have to set its value
explicitly and alter your syntax.

David

 
 
 

1. Problem opening a query in ACCESS through workgroup connection string

i have a following connection string which is perfectly fine and i can
successfully access to the ACCESS database through workgroup
connection string.

"Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=C:\Shared\NetAccessDatabase\Net.mdb;user
id=SYSTM;Password=tmsa;Jet OLEDB:System
database=c:\Winnt\system32\system.mdw;"

once i have accessed to the ACCESS databae i have tried to open a
query called vtblDefaultSegment...The code for query
vtblDefaultSegment is as follows:

 SELECT [IDSegment]
FROM tblTMSGroups
WHERE GroupID=SYSTM;

 when i do this i should get one record back but instead i get an
error messaga saying "No value given for one or more required
parameters"...I would really appreciate if some one could really help
me with this...Seems like i couldn't open the query
vtblDefaultSegment..Thanks

2. experienced programmers needed!!!

3. Specifiying a Workgroup File When Using ADO to Open an Access .mdb file (OLEDB)

4. Stored Proc dynamic cursors ....

5. Webserver 2.1 (on NT) and Networkfilesystems

6. Problem Replicating SQL Server 2000 Database With Access 2000 Database With Workgroup

7. RDBMS nucleus

8. Problem Replicating SQL Server 2000 Database With Access 2000 Database With Workgroup Information File

9. SQL7 and Access 2000 Repl.-Problem: Workgroup missing

10. Problem accesing to Access Workgroup from Win98

11. Access Workgroup File Security Problem.