Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old November 15th, 2003, 02:15 AM
abbakha abbakha is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 3 abbakha User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Talking Calling parametrized stored procedure from MS Access

Hi
I am trying to pass date parameters from MS Access form to stored procedure on SQL server . When I execute the code I am getting an error on "qd.execute " The error message is

Number: 3065
Source : DAO.QueryDef
Text: Can not execute selected Query.


I am pasting the code here so If someone have any idea what would be the problem

Dim db As Database
Dim qd As QueryDef
Dim rs As Recordset
Dim fld As Field
Dim datStartDate, datEndDate As Date

'Getting the user inputs from Ms Access form
datStartDate = [Form_Archive Information].StartDate
datEndDate = [Form_Archive Information].EndDate
Set db = CurrentDb ' Setting the database as current Database
On Error Resume Next
db.QueryDefs.Delete ("GCS_PQ_ARCHIVED_RECORDS") 'deleting the old defination of pass-through query
On Error GoTo ErrorHandler
Set qd = db.CreateQueryDef("GCS_PQ_ARCHIVED_RECORDS") 'define new query defination
qd.ReturnsRecords = False ' Query do not retrieve records
'Connection string
'user id and password is deliberately hide before posting the code
qd.Connect = "ODBC;DSN=DSN_RACK_BARREL; UID=kabxxxx, PWD=xxxxx;DATABASE=RACKBARREL"
qd.SQL = "Exec GCS_SP_Archived_Records " & "'" & datStartDate & "'" & ", " & "'" & datEndDate & "'"
qd.Execute
qd.Close

ErrorHandler:
DisplayDAOError


Note: I Already add teh The reference libraries Microsoft ADO 3.6 reference library
I have permission on databse and all the related tables .
if I run the above pass-through query in development mode it works.
stored procedure was tested .

The problem is on db.execute line. It fails whenever I run the code
I also check the permissions on related tables for the user used in connection string. I don't know where the problem is.

Please help !!!!

Reply With Quote
  #2  
Old December 5th, 2003, 11:54 PM
Jkrishnaswamy Jkrishnaswamy is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: Plainsboro, NJ
Posts: 5 Jkrishnaswamy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 m 7 sec
Reputation Power: 0
You should use an Access Project instead of DAO, what version of Access are you using?

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Calling parametrized stored procedure from MS Access


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump





 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek