Re: Recordset problem....

Salai Sivadhanam <[email protected]> Thu, 15 May 2003 15:53:17 +0530
Newsgroups gmane.comp.windows.devel.vbcom
Message-ID <[email protected]>
Hello Mr. Alireza Kheyrollahi....=20

Here is the function which will get the insert query and processes...=20

Public Function changedata(sqlstr As String) As String
On Error goto errHandler
        changedata =3D ""
         objCon.Execute sqlstr
        changedata =3D kStrMsgSuccess
errHandler:
If Err.Number <> 0 Then
    changedata =3D Err.Number & " : " & Err.Description
End If
End Function

And, Here is my another function which will get select  query as =
parameter and will return the recordset....=20

Public Function SelectData(sqlstr As String) As Recordset
On Error goto errHandler
        Dim rs As New ADODB.Recordset=20
rs.CursorLocation =3D adUseClient
        rs.Open sqlstr, objCon, adOpenStatic, adLockReadOnly  =20
        Set SelectData =3D rs
ErrHandler:
If Err.Number <> 0 Then
    Set SelectData =3D Nothing
End If
End Function

Then also, the problem is coming.... It's failing to select the record =
immediately after submitting the data.... I am getting "[Microsoft][ODBC =
Microsoft Access Driver] Not a valid bookmark." error.... How to solve =
this problem....=20

Salai

-----Original Message-----
From: Technical discussion of VBCOM [mailto:[email protected]]On =
Behalf Of Alireza Kheyrollahi
Sent: Thursday, May 15, 2003 4:08 AM
To: [email protected]
Subject: Re: [VBCOM] Recordset problem....

Always include a snippet of your code. Have you set CursorLocation to
adUseClient?


----- Original Message -----
From: "Salai Sivadhanam" <[email protected]>
To: <[email protected]>
Sent: Wednesday, May 07, 2003 2:22 PM
Subject: [VBCOM] Recordset problem....


Hi All....

I am using VBCOM component to deal with the database, and I am using MS
Access for my project.... I am fetching the records in a recordset which =
is
created within a DLL....

Sometime, I am submitting a record into DB, and, immediately I am trying =
to
retrieve that record.... At that time, my DLL is returning nothing, but =
not
a recordset.... But, if I do slowly, or in a debug mode, it's fetching
properly and returning the recordset without any problem.... How to =
overcome
this problem....? Will anyone suggest me....??

Salai

You can read messages from the VBCOM archive, unsubscribe from VBCOM, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the VBCOM archive, unsubscribe from VBCOM, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

You can read messages from the VBCOM archive, unsubscribe from VBCOM, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.