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:
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
  #1  
Old November 15th, 2003, 01: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, 10: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: < 1 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!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

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





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway