By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,180 Members | 1,012 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,180 IT Pros & Developers. It's quick & easy.

Connecting VB front end to Excel as a back end

P: 75
Hello.,
I want to connect my VB front end application to Excel as a back end,
to save, edit, update, delete etc..
Can anybody help me... Pls...........

Thanking You,
Manju
Nov 21 '08 #1
Share this Question
Share on Google+
2 Replies


QVeen72
Expert 100+
P: 1,445
Hi,

Add ADO Reference to your Project,
and use this connection string :

Expand|Select|Wrap|Line Numbers
  1. Dim Con as New ADODB.Connection
  2. Dim RST As New ADODB.Recordset
  3. Dim sSQL As String
  4. With Con
  5.     .Provider = "Microsoft.Jet.OLEDB.4.0"
  6.     .ConnectionString = "Data Source=C:\MyExcelWB.xls;" & _
  7.         "Extended Properties=Excel 8.0;"
  8.     .Open
  9. End With
  10. sSQL = "SELECT * FROM [Sheet1$]"
  11. RST.Open sSQL,Con,1,3
  12.  
  13.  
Each Worksheet Acts as a Table,
Usually, First Row of the Sheet Is Field Names..
If, not, then Connection string need to be changed to :

Expand|Select|Wrap|Line Numbers
  1. "Extended Properties=" " Excel 8.0; HDR=No;" " "
  2.  

REgards
Veena
Nov 21 '08 #2

P: 75
Hi,
Thanks a lot.
I get it.
I've created VB application which uses VISDATA as a backend.
Here I used SQL statements for all Queries.
This works well in WIndows XP.
But when I try to install it in UBUNTU.,its showing an error
'Run Time Error 429: ActiveX can't create object.
Would you please help me step by step regarding this.,
Hope I will get solution from you.
Dec 4 '08 #3

Post your reply

Sign in to post your reply or Sign up for a free account.