Hello,
Access XP, SQL Server 2000
Is it possible to hide a SP under Queries in Access, yet still be able
to Execute it from Access?
We hooked up a custom form to accept the input parameters (MS Feature
Request!) for the Stored Procedure. We had two problems with MS's
'Input Parameter' dialog: 1) We could not customize, 2) We continually
received a message from Access stating, "The stored procedure executed
successfully but did not return records" ('SET NOCOUNT ON' gave no
joy).
Below is the sample code we are using.
TestInsert is the SP
txtName is a text box on the form
@name is char(80)
Private Sub cmdAdd_Enter()
Dim cmd As New ADODB.Command
Dim par As Parameter
Set cmd.ActiveConnection = CurrentProject.Connection
cmd.CommandText = "TestInsert"
cmd.CommandType = adCmdStoredProc
Set par = cmd.CreateParameter("@name", adVarChar, _
adParamInput, Len(txtName), txtName)
cmd.Parameters.Append par
cmd.Execute
Set cmd = Nothing
End Sub
Any help would be appreciated. We successfully hid our Tables, and
allowed access through Views. But we can't seem to find a good work
around here.
Thanks
Jeff
Jeffrey Walton
noloader 4 3481
Noloader (no******@yahoo.com) writes: Is it possible to hide a SP under Queries in Access, yet still be able to Execute it from Access?
We hooked up a custom form to accept the input parameters (MS Feature Request!) for the Stored Procedure. We had two problems with MS's 'Input Parameter' dialog: 1) We could not customize, 2) We continually received a message from Access stating, "The stored procedure executed successfully but did not return records" ('SET NOCOUNT ON' gave no joy).
I have to admit that I understand very little of this. But it could
be because I don't know Access. Probably you should put this question
to comp.databases.ms-access instead.
As for the procedures not returning result sets - did you expect them
to return result sets? Did you run them from Query Analyzer?
--
Erland Sommarskog, SQL Server MVP, so****@algonet.se
Books Online for SQL Server SP3 at http://www.microsoft.com/sql/techinf...2000/books.asp
The most common advice is not to use the @ character in variable nemes with
the Jet engine. If this does not work then a specific cast of the input vale
to the parameter type might work.
Martin
"Noloader" <no******@yahoo.com> wrote in message
news:6b**************************@posting.google.c om... Hello,
Access XP, SQL Server 2000
Is it possible to hide a SP under Queries in Access, yet still be able to Execute it from Access?
We hooked up a custom form to accept the input parameters (MS Feature Request!) for the Stored Procedure. We had two problems with MS's 'Input Parameter' dialog: 1) We could not customize, 2) We continually received a message from Access stating, "The stored procedure executed successfully but did not return records" ('SET NOCOUNT ON' gave no joy).
Below is the sample code we are using. TestInsert is the SP txtName is a text box on the form @name is char(80)
Private Sub cmdAdd_Enter()
Dim cmd As New ADODB.Command Dim par As Parameter
Set cmd.ActiveConnection = CurrentProject.Connection
cmd.CommandText = "TestInsert" cmd.CommandType = adCmdStoredProc
Set par = cmd.CreateParameter("@name", adVarChar, _ adParamInput, Len(txtName), txtName)
cmd.Parameters.Append par
cmd.Execute
Set cmd = Nothing
End Sub
Any help would be appreciated. We successfully hid our Tables, and allowed access through Views. But we can't seem to find a good work around here.
Thanks
Jeff Jeffrey Walton noloader
Erland Sommarskog <so****@algonet.se> wrote in message news:<Xn*********************@127.0.0.1>... Noloader (no******@yahoo.com) writes: Is it possible to hide a SP under Queries in Access, yet still be able to Execute it from Access?
We hooked up a custom form to accept the input parameters (MS Feature Request!) for the Stored Procedure. We had two problems with MS's 'Input Parameter' dialog: 1) We could not customize, 2) We continually received a message from Access stating, "The stored procedure executed successfully but did not return records" ('SET NOCOUNT ON' gave no joy). I have to admit that I understand very little of this. But it could be because I don't know Access. Probably you should put this question to comp.databases.ms-access instead.
Thanks for the suggestion. Done.
As for the procedures not returning result sets - did you expect them to return result sets? Did you run them from Query Analyzer?
The SP does not return any records (its a basic insert). I don't
understand why Access is throwing the dialog. I take a cockpit
approach - silent is good. Don't flash the lights and blow the whistle
until something goes wrong.
Thanks for the help Erland and Martin.
Jeff no******@yahoo.com (Noloader) wrote in message news:<6b**************************@posting.google. com>... Hello,
Access XP, SQL Server 2000
Is it possible to hide a SP under Queries in Access, yet still be able to Execute it from Access?
We hooked up a custom form to accept the input parameters (MS Feature Request!) for the Stored Procedure. We had two problems with MS's 'Input Parameter' dialog: 1) We could not customize, 2) We continually received a message from Access stating, "The stored procedure executed successfully but did not return records" ('SET NOCOUNT ON' gave no joy).
Below is the sample code we are using. TestInsert is the SP txtName is a text box on the form @name is char(80)
Private Sub cmdAdd_Enter()
Dim cmd As New ADODB.Command Dim par As Parameter
Set cmd.ActiveConnection = CurrentProject.Connection
cmd.CommandText = "TestInsert" cmd.CommandType = adCmdStoredProc
Set par = cmd.CreateParameter("@name", adVarChar, _ adParamInput, Len(txtName), txtName)
cmd.Parameters.Append par
cmd.Execute
Set cmd = Nothing
End Sub
Any help would be appreciated. We successfully hid our Tables, and allowed access through Views. But we can't seem to find a good work around here.
Thanks
Jeff Jeffrey Walton noloader
2) We continually received a message from Access stating, "The stored procedure executed successfully but did not return records" ('SET NOCOUNT ON' gave no joy).
We modified the Execute call:
Dim cmd As New ADODB.Command
Dim par As Parameter
Set cmd.ActiveConnection = CurrentProject.Connection
cmd.CommandText = "TestInsert"
cmd.CommandType = adCmdStoredProc
Set par = cmd.CreateParameter("@name", adVarChar, _
adParamInput, Len(txtName), txtName)
cmd.Parameters.Append par
cmd.Execute , , adExecuteNoRecords
Set cmd = Nothing
Set par = Nothing
Jeff This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Les Juby |
last post by:
I have a customer with an extensive intranet which contains a lot of
sensitive company data. The client is concerned that any employee
could download source code back to removable storage and...
|
by: Joris Kempen |
last post by:
Hi people,
I know that the question has come around sometimes:
How to open an Access Report using ASP and export it to for example
RTF.
I'm trying to implement the first method of David...
|
by: shumaker |
last post by:
I'm wondering how/why this query works. Trying to get my head wrapped
around SQL. Basically the Query deletes from the Import table all
records that are already in FooStrings so that when I do an...
|
by: Noloader |
last post by:
Hello,
Access XP, SQL Server 2000
Is it possible to hide a SP under Queries in Access, yet still be able
to Execute it from Access? (Similar to hiding Tables, then using
Views)
We hooked...
|
by: Jarrod |
last post by:
I have multiple reports in one database, on one form. I need to know
what reports were run when, and by Network User ID. How do I do that?
|
by: Ray |
last post by:
Does anyone out there have experience with using Db2 8.2 with a program
called MISys (also known as ACCPAC). I am having some problems with the
application running exteremly slow on workstations...
|
by: smaczylo |
last post by:
Hello, I've recently been asked to work with Microsoft Access, and
while I feel quite comfortable with Excel, I'm at a complete loss with
databases. If someone could help me with this issue I'm...
|
by: HowardChr |
last post by:
I have my program set up so that when a button called "Clear" is clicked, it
clears all Yes/No fields from a seperate table. The problem is that when
that button is clicked, it is coming up with 2...
|
by: jsacrey |
last post by:
Hey everybody, got a secnario for ya that I need a bit of help with.
Access 97 using linked tables from an SQL Server 2000 machine.
I've created a simple query using two tables joined by one...
|
by: magickarle |
last post by:
Hi, I got a pass-through query (that takes about 15 mins to process)
I would like to integrate variables to it.
IE: something simple:
Select EmplID from empl_Lst
where empl_lst.timestamp between...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
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...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
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...
|
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,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| | |