Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Duplicate info in a database | Excel Discussion (Misc queries) | |||
Link info in one cell to info in several cells in another column (like a database) | Excel Discussion (Misc queries) | |||
Look up info in a database using 2 conditions | Excel Worksheet Functions | |||
Importing access database info into excel | Links and Linking in Excel | |||
Database info in Word doc | Excel Programming |