Linker IT Software
Google
Web www.oraxcel.com
menubar-top-links menubar-top-rechts
Home Help Search Login
Welcome, Guest. Please Login.
SQL*XL: Database to Excel bridge litLIB: Excel power functions pack ExcelLock: Locking and securing your valuable Excel spreadsheets encOffice: Protect your Excel file easy and safe encOffice: Protect your Excel file easy and safe
Pages: 1
Automating updates (Read 1864 times)
Gerrit-Jan Linker
YaBB Administrator
*****




Posts: 75
Automating updates
27.09.10 at 10:38:31
 
Automating updates
 
Quote:

To send update statements to the database I am using the following approach. In a macro I am creating update statements on the basis of the data on the sheets. These statements are stored in string variables str1, str2, etc.

I use the following commands to run these statements:

SQLXL.Sql.setText str1
SQLXL.Sql.Statements(1).Execute

SQLXL.Sql.setText str2
SQLXL.Sql.Statements(1).Execute

SQLXL.Sql.setText str3
SQLXL.Sql.Statements(1).Execute

but when I use the settext / execute it seems the db does not get updated.
It appeart to run when I step through but the db does not actaully get set. It seems Statements(1) is set correctly on examination in debugger as well.

Any ideas why?

 
Yes, I think you forget to issue a commit. You can use the commit function in the database object: sqlxl.database.commit or you can run a SQL commit statement.
 
See also:
SQL*XL help: Database object
http://www.oraxcel.com/projects/sqlxl/help/vba/SQLXL/Database/index.html
Back to top
 
 

Gerrit-Jan Linker
Linker IT Software
Email WWW Gerrit-Jan Linker   IP Logged
Pages: 1