Wrox Programmer Forums
|
VB Databases Basics Beginning-level VB coding questions specific to using VB with databases. Issues not specific to database use will be redirected to other forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB Databases Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 8th, 2006, 04:59 AM
Registered User
 
Join Date: Aug 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to AhmedMuneeb
Default Help me out...!

Hi All,

Im working on VS app which fetches data from excel sheet and its working really well but the problem is now i want to update the excel sheet using code....! Im using this code


objConn.Open()
sql = "Insert into [Data$] (Projectc, Projectn, Customer, Endu, Projectm) values ('asdasd','asda','kjljkl','wqe','sdsadxc')"

Dim objCommand As New OleDb.OleDbCommand(sql, objConn)
Dim objAdapter As New OleDb.OleDbDataAdapter(objCommand)
objCommand.CommandText = sql
objCommand.ExecuteNonQuery()
objConn.Close()

But it is not accepting the column names... so please help me out...!

Ahmed Muneeb
Cell No. +93-321-6218648
 
Old August 8th, 2006, 11:03 AM
Friend of Wrox
 
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

(Your post’s subject line should be something like "Can't Update Excel with OLEDB" so that people know something about . . . well . . . the subject. Everyone posting a question wants help, after all... Just a tip.)

Do you wind up with an error (if so, what is the error message, and on which line does it occur), or does the program just silently do nothing?









Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.