 |
suryasatya Level: Big Cheese
 Registered: 08-08-2006 Posts: 20
|
DataGrid Problem -- Urgent
Hi Guyz,
I m using DataGrid control to show my .MDB file data. One of our customer using same mdb file to modify the contents of file by using their EXE and giving to application. But, updated data is not reflecting back quickly into the grid. Its taking around 5 or 10 secs sleep but this is unacceptable.
Before customer changing contents of db we are closing all handle to database/recordset. before returning their EXE they are also closing all handles.
Still data is not updating quickly into the grid.
Anyone Help me pls. this is customer issue. any code samples good for me.
Thanks,
Surya.
____________________________
surya satya
|
|
30-01-2007 at 07:54 AM |
|
|
suryasatya Level: Big Cheese
 Registered: 08-08-2006 Posts: 20
|
Re: DataGrid Problem -- Urgent
Hey Guyz, I forgot to mention one more thing. I m using VB6 and DAO for database access.
appreciate your help!!!
____________________________
surya satya
|
|
30-01-2007 at 08:52 AM |
|
|
suryasatya Level: Big Cheese
 Registered: 08-08-2006 Posts: 20
|
Re: DataGrid Problem -- Urgent
Hi,
Thanks for your reply but I dont have enough knowledge to change the lock types of exe. can you suggest how to do it or some sample code to do the same.
Thx in advance.
____________________________
surya satya
|
|
31-01-2007 at 01:20 PM |
|
|
yronium Level: Moderator

 Registered: 14-04-2002 Posts: 933
|
Re: DataGrid Problem -- Urgent
Well, there are plenty of samples around the web. Basically, consider the following code: Option Explicit
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Private Sub Form_Load()
Dim cnstr As String
Dim sql As String
' open the connection
Set cn = New ADODB.Connection
cnstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\ProgramFiles\MyData\MyDataBase.mdb;Mode=ReadWrite;Persist Security Info=False"
cn.Open cnstr
' open the recordset
Set rs = New ADODB.Recordset
sql = "SELECT * FROM Table1 ORDER BY Surname;"
rs.CursorLocation = adUseClient
rs.Open sql, cn, adOpenDynamic, adLockOptimistic, adCmdText
' [...other code...]
End Sub | You can either set recordset's LockType property before opening it, or you can pass the LockType argument to recordset's Open method, like in the above sample.
In the line| rs.Open sql, cn, adOpenDynamic, adLockOptimistic, adCmdText | ...the fourth argument allows you to specify the lock condition for opening the database. There are four locktypes avaliable, you can find the meaning of each one into the Online Help.
But however, I'm assuming you got the permission/capability to edit and recompile your customer's exe. You didn't specify if you own the project/the code of your customer's exe in order to modify it. But there's no other way to modify the lock type (and yet, we're not sure it'll solve the problem).
Hope it helps
____________________________
Real Programmer can count up to 1024 on his fingers
|
|
01-02-2007 at 12:15 AM |
|
|
|
|
 |
 |