Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

issues re getting current Access data for reporting... 1

Status
Not open for further replies.

jjjacko

Vendor
May 15, 2001
3
NZ
I've got VB Ent 6 and have a programme written based on Access data. My reports are all created using the VB Data Report Generator, based on Data Connection/Environment set up. It all works fine SOME of the time, but at other times I'm not getting the CURRENT data..... beats me!!!!

I am doing a reQuery and am rebinding DataSource and Data Member following that.... problem remains....


If there's anyone out there who's had similar issues I'd love to hear... any suggestions gratefully received.
 
I write all my database routine manually, I heard back several VB versions ago, that using the controls is slower. I do notice after I execute a SQL statement that the data doesnt immediatly show, so, I'm now in the habbit of closing the database before I do another operation and that seems to give me updated info.

Example:
Code:
Dim Adbs As New ADODB.Connection
Dim SQL As String, MyID as Long, NewName as String
Dim TimeWork As New ADODB.Recordset
'
Set Adbs = New ADODB.Connection
Adbs.Open "DSN=ChapACC;", "administrator", ""
'
NewName = "Jones"
MyID = 10
'
SQL = "update timework set name = '" & NewName & "' where timeid = " & MyID & ";"
Set TimeWork = Adbs.Execute(SQL)
'
TimeWork.Close
Set TimeWork = Nothing
'
SQL = "select * from timework"
Set TimeWork = Adbs.Execute(SQL)
If Not TimeWork.EOF And Not TimeWork.BOF Then
   TimeWork.MoveFirst
   ' do something
End If
TimeWork.Close
Set TimeWork = Nothing
adbs.close
set adbs = Nothing

Hope this helps, I don't use the data report designer so I might not be ansering correctly, maybe someone else can shed some more light.s-)
 
Thanks dalec - great to know that someone has had similar issues....

I have other processes running which update different tables, so am not able to close and open database. Have tried closing and opening recordset, but no joy.

Am now thinking to try a different tack and call Access report from VB - from this forum it looks as if this SHOULD be possible!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top