Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How to insert record into an sql table using vba

Author  Topic 

gs
Starting Member

14 Posts

Posted - 2009-07-15 : 12:37:46
Hi,
I have a table in sql server with four records- supplierID,suppliername,start year and end year. I would need the inputs using inputbox in excel vba...I want to transfer that data as 'insert into ' in sql table..
I am new to SQL and VBA.
Please help.
Thanks

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-07-15 : 12:40:31
you need to design the form in vb and then use a stored procedure to pass values down to sql as parameters. the sp will be like

CREATE PROC InsertData
@supplierID int,
@suppliername varchar(50),
@start year int,
@end year int
AS
BEGIN
INSERT INTO YourTable VALUES (@supplierID,@suppliername,@start year ,@end year)

END
GO
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-07-15 : 12:45:07
also see


http://support.microsoft.com/kb/146651
Go to Top of Page
   

- Advertisement -