473,387 Members | 1,517 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

I do not get any results with my stored procedure

Hi there:

I am trying to use a stored procedure which selects rows according to a pattern (well, a parameter I am passing to it) something like this:

create procedure sp_selpar_selecciono_nombres(@nomb varchar(15)) as
select first_name_vc,last_name_vc
from customer_t
where last_name_vc like '%@nomb%'

Note: I use SqlServer 7.0

Then, from vb 6.0 a call it like this:

Dim conn As New ADODB.Connection
Dim rs As New ADODB.Recordset
Dim last_name As String

Private Sub Form_Load()

last_name = "what ever"

conn.Open "driver=sql server;server=informat01;database=wrox"

If conn.State = adStateOpen Then

'call stored procedure with one parameter
rs.Open "pablo.sp_selpar_selecciono_nombres('" & last_name & "')", conn, adOpenStatic, adLockReadOnly, adCmdStoredProc

'load the grid with the recordset...
Set grid.DataSource = rs

End If

End Sub

And I see no records in the grid.....
Can I have some help with this? Thank you in advance.
Oct 19 '06 #1
0 891

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: John | last post by:
Hi everyone, I have a stored procedure which I use to query a table. The first part of the stored procedure uses a cursor to update a temp table whilst the second part of the query actually...
2
by: Jegg | last post by:
I wrote a web app using an ASP front end (not .NET) connecting to a SQL Server 2000 (no SP) back end. Both the web server and the database server are Windows 2003 boxes. The app was running fine...
4
by: Mike Dinnis | last post by:
Hi, I've been working through a number of turorials to try to learn more about retrieving data from a SQL database. I think i've mastered techniques where i create a sql string in the page and...
2
by: Sandy | last post by:
Hello - I have the following stored procedure and code. I want to put the results in two textboxes. I get to the part where I create the dataset and then I don't know what to do. I tried...
2
by: Patrick Olurotimi Ige | last post by:
When i run the code below with stored proc :- I get only the first table results :-"templates" even if i fill the dataset with another table for example category,pages etc.. Any ideas? ...
6
by: Jim | last post by:
Can someone, please, show me how to display the results of a stored procedure in a VB.NET datagrid on a winform? I'm a newbie. Here's my SQL 2000 stored precedure that returns the status of...
4
by: jaYPee | last post by:
I have downloaded some source code but I want this to convert the results into datagrid. dr = cmd.ExecuteReader() '**************************************** ' SHOW THE RESULTS...
6
by: Uday | last post by:
Hi everyone, I have a ASP page that triggers a db-side stored procedure. At the end of the procedure, it spits out a log file, that this ASP page reads and displays for the users. But the...
1
by: Chris | last post by:
Hi, I created a VB SQL CRL Stored procedure for calculating a value. Value is returned as below Using sConn4 As New SqlConnection("context connection=true") sConn4.Open() scmd = New...
4
by: gayano | last post by:
Hi I'm Tried Lot's of forums but still no Answer Can you guys help me? What i have is a Stored procedure looks like this ALTER PROCEDURE dbo.DriveSearch @Driver varchar(50) AS SELECT...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.