borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2008 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Next Topic (ADO how to Add new recordset) New Topic New Poll Post Reply
AndreaVB Forum : Database : DataGrid Problem -- Urgent
Poster Message
suryasatya
Level: Big Cheese

Registered: 08-08-2006
Posts: 20

icon 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
View Profile Send Email to User Show All Posts | Quote Reply
suryasatya
Level: Big Cheese

Registered: 08-08-2006
Posts: 20
icon 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
View Profile Send Email to User Show All Posts | Quote Reply
yronium
Level: Moderator


Registered: 14-04-2002
Posts: 933
icon Re: DataGrid Problem -- Urgent

Hello.
Sometimes SQL Server performs a lack of speed, due to its cache refreshing method, but you're using MSAccess97 so db updates are (say, would be) made suddenly.

Rather, it sounds like your customer's exe operates a pessimistic lock while editing data. So your side is not updated after five or ten seconds, but after your customer has killed his exe, or at least has ended its edit state. If this is the case, you can only modify his exe's lock type.

Hope it helps.

____________________________
Real Programmer can count up to 1024 on his fingers

30-01-2007 at 02:28 PM
View Profile Send Email to User Show All Posts | Quote Reply
suryasatya
Level: Big Cheese

Registered: 08-08-2006
Posts: 20
icon 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
View Profile Send Email to User Show All Posts | Quote Reply
yronium
Level: Moderator


Registered: 14-04-2002
Posts: 933
icon 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
View Profile Send Email to User Show All Posts | Quote Reply
mcdongs
Level: Trainee

Registered: 31-01-2008
Posts: 1
icon Need for help how to find record from visual basic using adodc

We need a information about the searching using adodc from the visual basic.....

I try to search something information from yahoo When i got it i try to create a program, then doesn't work....

Please help me.....






____________________________
mcdongscute

31-01-2008 at 01:02 AM
View Profile Send Email to User Show All Posts | Quote Reply
stickleprojects
Level: Moderator


Registered: 09-09-2002
Posts: 987
icon Re: DataGrid Problem -- Urgent

McDongs
Can you explain how your problem relates to suryastya's issue? If not, please create a seperate topic and explain your actual problem in detail.
You will find that "I can't use VB" doesn't get many responses on q&a forums

Regards
Kieron

PS. The process of adding a different question to the end of an existing topic is called Hi-Jacking and is not considered polite.

____________________________
Build it better, faster, quicker, easier.. then fix it (non-offical MS mission statement)

31-01-2008 at 02:10 PM
View Profile Send Email to User Show All Posts | Quote Reply
yronium
Level: Moderator


Registered: 14-04-2002
Posts: 933
icon Re: DataGrid Problem -- Urgent

quote:
stickleprojects wrote: PS. The process of adding a different question to the end of an existing topic is called Hi-Jacking and is not considered polite.
... moreover when who does it disappears from the forum after it. It's annoying.


[Edited by yronium on 03-02-2008 at 03:00 PM GMT]

____________________________
Real Programmer can count up to 1024 on his fingers
03-02-2008 at 02:00 PM
View Profile Send Email to User Show All Posts | Quote Reply
AndreaVB Forum : Database : DataGrid Problem -- Urgent
Next Topic (ADO how to Add new recordset) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2008 Andrea Tincaniborder