views:

37

answers:

1
Dim conn, spinsert
Set conn = Server.CreateObject("ADODB.Connection")

conn.Open " Provider=sqloledb;Data Source=eightprinter;Initial Catalog=Movetest;User Id=moving;Password=moving123"
If conn.errors.count = 0 Then
    Response.Write "Connected <br>" 
    spinsert = "dbo.Sp_Companydetails_Insert "&errCompname&" , "&errUser&" ,"&errPwd&" ,"&errBilling&","&errRbmover&","&errStatus&","&errSales&","&errContract&","&errMail&","&errPhone&","&errComment&","&errCreated&" ,"&errModified&""

    conn.Execute(spinsert)
    conn.close
End if

Trying to insert values into table through a stored procedure.

The above code shows incorrect syntax near conn.Execute(spinsert).

+3  A: 
  • You are triying to execute the Stored Procedure over the connection, bad idea.
  • All your parameters are numeric? i cant see any "'" into the parameters. The String parameters needs to be with "'"

You can found information about the correct way to call stored procedures using ADO with ASP Pages on this Microsoft Support page http://support.microsoft.com/kb/164485

Dubas
+1 for link to parameter usage example.
My Other Me