Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Best way to add info to a SQL database from Excel

I am programming excel to update data from a spreadsheet
into a blank database. I can update the database if there
is a record in it but I can't seem to add a new record
(using .AddNew). I keep getting read only errors and I
cannot figure you what is wrong.

I am using DAO with a DSN to connect to a SQL server

Set wrkODBC = CreateWorkspace("NewODBCWorkspace", _
[MyUser], [MyPassword], dbUseODBC)
With dbsFITSDB
Set rstTemp = dbsFITSDB.OpenRecordset("my_input")

Set dbsFITSDB = wrkODBC.OpenConnection([Connect],
dbDriverNoPrompt, False)

strQueryUpdateFX = "UPDATE my_input ....... "
rstTemp.addnew
dbsFITSDB.Execute strQueryUpdateFX
End With
End With
Wend
dbsFITSDB.Close
wrkODBC.Close
End Sub

Thanks!
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Duplicate info in a database [email protected] Excel Discussion (Misc queries) 1 April 17th 08 10:02 AM
Link info in one cell to info in several cells in another column (like a database) hansdiddy Excel Discussion (Misc queries) 1 February 22nd 06 02:27 AM
Look up info in a database using 2 conditions cbuker Excel Worksheet Functions 0 January 25th 06 08:59 PM
Importing access database info into excel jwr Links and Linking in Excel 2 April 11th 05 02:13 PM
Database info in Word doc Debra Dalgleish[_2_] Excel Programming 0 September 3rd 03 09:20 PM


All times are GMT +1. The time now is 12:34 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"