Welcome to Tech Support Forum home to more then 136,000 problems solved. Issues have included: Spyware, Malware, Virus Issues, Windows, Microsoft, Linux, Networking, Security, Hardware, and Gaming Getting your problem solved is as easy as:
1. Registering for a free account
2. Asking your question
3. Receiving an answer

Registered members:
* Get free support
* Communicate privately with other members (PM).
* Removal of this message
* See fewer ads.
* And much more..

 



Want to know how to post a question? click here Having problems with spyware and pop-ups? First Steps
Go Back   Tech Support Forum > The IT Pro > Programming
User Name
Password
Site Map Register Donate Rules Blogs Mark Forums Read


Programming A discussion forum for programs and programming used in tech-related businesses.

Reply
 
LinkBack Thread Tools
Old 05-12-2009, 11:48 AM   #1 (permalink)
Registered User
 
Join Date: May 2009
Posts: 1
OS: XP


Vb6.0 application not responding

I am reading Excel File in Vb6.0, which has 2 sheets. Sheet1 contains 30,000 records and Sheet2 contains 30,000. I want to compare records present in both sheets.

Query1 = "SELECT * FROM [Sheet1$] order by LOV_TYPE,LOV_VALUE,LIC,PARENT_LIC,LANGUAGE_ID" 'Sorting Order
sconn1 = "DRIVER=Microsoft Excel Driver (*.xls);" & "DBQ=" & ExcelFileName
Dim rs1 As ADODB.Recordset
Set rs1 = New ADODB.Recordset
rs1.CursorLocation = adUseClient
rs1.CursorType = adOpenKeyset
rs1.LockType = adLockBatchOptimistic
rs1.Open Query1, sconn1
sheet1Array = rs1.GetRows

Query2 = "SELECT * FROM [Sheet2$] order by LOV_TYPE,LOV_VALUE,LIC,PARENT_LIC,LANGUAGE_ID" 'Sorting Order
sconn2 = "DRIVER=Microsoft Excel Driver (*.xls);" & "DBQ=" & ExcelFileName
Dim rs2 As ADODB.Recordset
Set rs2 = New ADODB.Recordset
rs2.CursorLocation = adUseClient
rs2.CursorType = adOpenKeyset
rs2.LockType = adLockBatchOptimistic
rs2.Open Query2, sconn2
sheet2Array = rs2.GetRows
dim matchedflag as integer
for Sheet1row=0 to rs1.recordcount then
matchedflag=0
for sheet2row=0 to rs2.recordcount then
if sheet2array(0,sheet2row)=sheet1array(0,sheet1row) and sheet2array(1,sheet2row)=sheet1array(1,sheet1row) and sheet2array(2,sheet2row)=sheet1array(2,sheet1row) and sheet2array(3,sheet2row)=sheet1array(3,sheet1row) and sheet2array(4,sheet2row)=sheet1array(4,sheet1row) then
MatchedFlag=1
end if
next sheet2row
if matchedflag=0 'sheet1 Record not found in sheet2
'coding to write this record into new excel sheet
end if
next sheet1row


Both Excel sheet(sheet1, sheet2) contains same column names, but data might be different. I have to find out the mismatched records and update the same in new excel sheet. While running the above code it is not responding and showing white(blank) screen.After 15 minutes the output is coming. I want to improve the performance. Please help ASAP. There may be more than 30,000 records in each sheet. Please provide the code to retrieve the data from excel sheet by specifying path of the excel file name(without creating DSN), sheet name and how to compare two records.
sankar1v is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Important Information
Join the #1 Tech Support Forum Today - It's Totally Free!

TechSupportForum.com is a leading support website for your computer needs. We offer free, friendly and personalized computer support. Why pay to have your computer fixed when you can do it for free.

Join TechSupportforum.com Today - Click Here

Old 05-13-2009, 01:36 AM   #2 (permalink)
As you wish
 
TJ Belfiore's Avatar
 
Join Date: Mar 2009
Location: 530
Posts: 3,499
OS: 7 x64, XP x32


Re: Vb6.0 application not responding

How many modules are in your program?
__________________
Signature by TJ Belfiore

TJ Belfiore is online now  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -7. The time now is 01:14 AM.



Copyright 2001 - 2009, Tech Support Forum
Home Tips Plus | Outdoor Basecamp | Automotive Support Forum

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85