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.
| Author |
Topic |
|
giovi2002
Starting Member
46 Posts |
Posted - 2005-08-03 : 20:11:11
|
| platform : access2003 adp / sql servergoal : pass a text value to procedureHow : Ado codeI've been trying to pass a text field to a sproc but it doesn't work. Within a form i have a control, this value needs to be passed.Within t-sql i defined @booktype varchar(50)In my ado codeDim strBooktype As StringAnd in the ado partmyado.Parameters.Append myado.CreateParameter("Booktype",adVarchar,50,adparaminput,StrBooktype)My dateparameter passing is working except the varchar...why?And why are the datatypes so difficult in compatibility between sqlserver and ado? |
|
|
timmy
Master Smack Fu Yak Hacker
1242 Posts |
Posted - 2005-08-03 : 20:40:25
|
| myado.Parameters.Append myado.CreateParameter("@Booktype",adVarchar,50,adparaminput,StrBooktype)You need to add the @ sign.The datatypes aren't vastly different, and in any case there is a comparison table in most ADO documentation. Do you know what version of ADO you're using? If you're using 2.5+, you don't need to explicitly declare your stored procedure parameters.Tim |
 |
|
|
giovi2002
Starting Member
46 Posts |
Posted - 2005-08-04 : 08:14:37
|
quote: Originally posted by timmy myado.Parameters.Append myado.CreateParameter("@Booktype",adVarchar,50,adparaminput,StrBooktype)
Hi Tim, In ado parametrization you don't need the @, the @ is a sql server sign within t-sql. For my dateparameters I'm not using @'s and they're working well. |
 |
|
|
giovi2002
Starting Member
46 Posts |
Posted - 2005-08-04 : 08:18:42
|
| Timmy, I dont know which ADO version I'm using. I'm using access2003 and sql server 2000 |
 |
|
|
kapilarya
Yak Posting Veteran
86 Posts |
Posted - 2005-08-04 : 08:51:00
|
| try using adChar instead of advarcharmyado.Parameters.Append myado.CreateParameter("Booktype",adchar,50,adparaminput,StrBooktype)Kapil Arya |
 |
|
|
|
|
|
|
|