Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Data to Table in SQL database 1

Status
Not open for further replies.

mpadgett

IS-IT--Management
Jun 24, 2005
57
US
I just finished taking an SQL Programming class to get an understanding of SQL's coding syntax and capabilities.

What I want to do now is take an existing Excel spreadsheet which I've developed and code it to do an INSERT into a table in our SQL Database.

Currently the spreadsheet is coded, with VBA, to email itself as an attachment to a user in another department who then manually enters the data. I'm wanting to replace that manual data entry process with an automatic process.

I was considering writing a Stored Procedure then using VBA to connect, execute the procedure with variable values passed to it.

I'm lacking in knowledge on what syntax to use, in VBA, to get the connection to the database established and to execute the Stored Procedure.

I'm new to SQL programming & I would consider myself a mid-level VBA programmer.

Any suggestions regarding getting this would be much appreciated.

Thanks - Mike P.
 
There should be plenty of examples in a VBA forum (and, frankly, your post belongs there, not a SQL forum).

If you're a "mid-level" VBA programmer, then connecting to SQL is little different from connecting to Access or any other datasource; the strings just have different attributes.

If you set a variable to the ADODB.Connection object, Intellisense should give you a good idea of where to go from there.

The SP is the best way to go. You just need a parameter for every field you want to populate.



Phil Hegedusich
Senior Programmer/Analyst
IIMAK
-----------
I'll have the roast duck with the mango salsa.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top