ADO querydef

J

Jonathan

With:

Cnxn = Server.CreateObject("ADODB.Connection")
Cnxn.open("Provider=Microsoft.Jet.OLEDB.4.0;" & "Persist Security
Info=TRUE;" & "Data Source=" & sPath, "Admin", "")

rs = server.createobject("adodb.recordset")

Can I use:

rs.open("qryMyStoredMSAccessQuery1", Cnxn, 2, 2)

instead of:

rs.open(strSQLText, Cnxn, 2, 2)

?
 
D

Douglas J. Steele

Jonathan said:
With:

Cnxn = Server.CreateObject("ADODB.Connection")
Cnxn.open("Provider=Microsoft.Jet.OLEDB.4.0;" & "Persist Security
Info=TRUE;" & "Data Source=" & sPath, "Admin", "")

rs = server.createobject("adodb.recordset")

Can I use:

rs.open("qryMyStoredMSAccessQuery1", Cnxn, 2, 2)

instead of:

rs.open(strSQLText, Cnxn, 2, 2)


Assuming qryMyStoredMSAccessQuery1 actually exists in the database, yes.
What happens when you try?
 
J

Jonathan

Good. I haven't tried yet but will advise if anything doesn't work.

While I am on the topic, I am building a new little asp.net website (in this
case hosted by GoDaddy) that has a few operations involving an Access
backend database.

So I am using Vb.net code to talk to the one mdb via ADO.

I assume that if later I need to switch to the 1 SQL server database
provided by GoDaddy on the plan I purchased, it's just a matter of changing:

Cnxn.open("Provider=Microsoft.Jet.OLEDB.4.0;" & "Persist Security
Info=TRUE;" & "Data Source=" & sPath, "Admin", "")

to something that would access the SQL database and I wouldn't need to
change any of the other VB.net code?

TIA
 
P

Peter Yang[MSFT]

Hello Jonathan,

If you use tables in your queries directly, I think you could only change
connection string when you upgrade your database from Access to SQL Server.
Since SQL Server don't have stored query as access, you have to use view or
stored procedure instead.

Best Regards,

Peter Yang
MCSE2000/2003, MCSA, MCDBA
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications
<http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx>.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
<http://msdn.microsoft.com/subscriptions/support/default.aspx>.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top