Connecting VB front end to Excel as a back end

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • premMS143
    New Member
    • Nov 2008
    • 75

    Connecting VB front end to Excel as a back end

    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
  • QVeen72
    Recognized Expert Top Contributor
    • Oct 2006
    • 1445

    #2
    Hi,

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

    [code=vb]
    Dim Con as New ADODB.Connectio n
    Dim RST As New ADODB.Recordset
    Dim sSQL As String
    With Con
    .Provider = "Microsoft.Jet. OLEDB.4.0"
    .ConnectionStri ng = "Data Source=C:\MyExc elWB.xls;" & _
    "Extended Properties=Exce l 8.0;"
    .Open
    End With
    sSQL = "SELECT * FROM [Sheet1$]"
    RST.Open sSQL,Con,1,3

    [/code]

    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 :

    [code=vb]
    "Extended Properties=" " Excel 8.0; HDR=No;" " "
    [/code]


    REgards
    Veena

    Comment

    • premMS143
      New Member
      • Nov 2008
      • 75

      #3
      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.

      Comment

      Working...