Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Open a recordset from excel with VB6

Posted on 2005-03-02
4
Medium Priority
?
436 Views
Last Modified: 2013-12-25
I need to get data from Excel to a recordset.
I found this code on the Internet, but I don't know what to do from here... How do I go from here to a recordset?  Is there a better way to do this?


oConn.Open "Driver={Microsoft Excel Driver (*.xls)};" & _
           "DriverId=790;" & _
           "Dbq=c:\somepath\mySpreadsheet.xls;" & _
           "DefaultDir=c:\somepath"

I plan to take this data and validate it and base on the validation, this data from excel will go into an access database if it passes the validation, while the errors will go into an error spreadsheet in Excel.  Although I worte the validation loop, I cannot use it because I don't know how many rows the spreadsheet has from where I get the data, each spreadsheet has a differnet number of rows.  I need to use a for loop for i=2 to rows.columns.count (this doesn't work either) so I thought I would use for i = 2 to recordset.EOF.  But I don't know how to get the recordset.  Can you please help me!!!
Angie
0
Comment
Question by:Angie532
2 Comments
 
LVL 53

Accepted Solution

by:
Dhaest earned 2000 total points
ID: 13447224
SAMPLE: ExcelADO Demonstrates How to Use ADO to Read and Write Data in Excel Workbooks

http://support.microsoft.com/?id=278973
0
 
LVL 5

Expert Comment

by:Pi7
ID: 13451200
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question