Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Closed Thread
 
Thread Tools Display Modes
  #1 (permalink)  
Old May 27th, 2004, 12:30 PM
Registered User
 
Join Date: May 2004
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Connecting VB Proj to a local Access DB

Hi,
I have been going around in circles on how to pass parameters to a select query in an access database from word using DAO. I keep getting a data type conversion error every time I run it. Maybe some one could help me.

Here is the SQL statement from my Access Query:
PARAMETERS [num] Text ( 255 );
SELECT tblTestingSummaryReport.[Date of Test], tblTestingSummaryReport.Index, tblTestingSummaryReport.[Study type]
FROM tblTestingSummaryReport
WHERE (((tblTestingSummaryReport.[SDC #])=[num]));


Here is the code from my VBA app:

   Dim MyWorkspace As Workspace
   Dim db As Database

   DBEngine.SystemDB = "System.mdw"
   Set MyWorkspace = DBEngine.CreateWorkspace ("Name", "DBAPaulD", pass)
    Set db = OpenDatabase("report.mdb", False, False)

   Dim rs As DAO.Recordset
   Dim qryDef As QueryDef

   Set qryDef = db.QueryDefs("qryRembrandtGetTSRIndex")
   qryDef.Parameters(0) = "13" 'This is text eventhough it is a number
   'This is where it crashes
   Set rs = qryDef.OpenRecordset("qryRembrandtGetTSRIndex")

Thanks


Closed Thread


Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Connecting to Access 20007 DB with vb.net JohnBoy VB.NET 1 May 21st, 2008 01:26 PM
Trouble connecting to Access DB thru IIS swoopest Classic ASP Databases 6 November 10th, 2004 09:13 AM
Connecting to Access via OLE-DB mairejo Access 3 October 26th, 2004 02:28 PM
Connecting to Access Db mattastic Classic ASP Databases 3 October 14th, 2004 02:32 AM
Connecting to another Access db with different IP ckentebe Access VBA 3 April 21st, 2004 12:08 AM



All times are GMT -4. The time now is 02:54 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.