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
 insert file problem?

Author  Topic 

sansoa666
Starting Member

2 Posts

Posted - 2010-01-08 : 05:38:54
hi can you pls take a look whats the problem regarding my code below.. i want this code is to save.. but i didn't.! pls help its related in SQL server..

Private Sub AeroButton2_Click()
Dim strname As String
Set cm = New Command
With cm
strname = "updatesupplier"
.ActiveConnection = CN
.CommandType = adCmdStoredProc
.CommandText = "SupplierSave"
.Parameters.Append .CreateParameter("@supid", adVarChar, adParamInput, 50, suppID.Text)
.Parameters.Append .CreateParameter("@supname", adVarChar, adParamInput, 50, SuppName.Text)
.Parameters.Append .CreateParameter("@conpreson", adVarChar, adParamInput, 50, conName.Text)
.Parameters.Append .CreateParameter("@contitle", adVarChar, adParamInput, 50, conTitlte.Text)
.Parameters.Append .CreateParameter("@address", adVarChar, adParamInput, 50, faxNo.Text)
.Parameters.Append .CreateParameter("@phon", adVarChar, adParamInput, 50, suppAdd.Text)
.Parameters.Append .CreateParameter("@fax", adVarChar, adParamInput, 50, phoneNo.Text)
.Execute
End With
End Sub

thank you..

practice makes perfect

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2010-01-08 : 05:58:23
1) The three last CreateParameter doesn't match the parameter value. FoxNo in Address?

Also, we need to see the code for stored procedure.



N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page

sansoa666
Starting Member

2 Posts

Posted - 2010-01-08 : 21:16:52
ok.. here is the code for storePrcedure..

CREATE PROCEDURE SupplierSave

@supid varchar(50),
@supname varchar(50),
@conpreson varchar(50),
@contitle varchar(50),
@address varchar(50),
@phon varchar(50),
@fax varchar(50)

AS

BEGIN
INSERT INTO
supplier([supid],[supname],[conpreson],[contitle],[address],[phon],[fax])
VALUES
(@supid, @supname,@conpreson,@contitle,@address,@phon,@fax)
end
GO
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-01-08 : 23:46:43
Are you getting an error? If you are, please post it as we can't see your environment.

Is supid in the supplier table an identity column? If it is, then you need to remove it from the stored procedure and application code as SQL Server manages it for you.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-01-09 : 10:07:51
also do you have any insert triggers present in table?
Go to Top of Page
   

- Advertisement -