Advertisement

05.20.2008 at 02:52AM PDT, ID: 23416480
[x]
Attachment Details

Need help getting my VBA code to return a recordset.

Asked by rgn2121 in Access Coding/Macros, Microsoft Access Database, Miscellaneous Programming

Tags: Access 2003, VBA

I know I am close and I have searched the internet and tried several different tutorials and coded them like the tutorial shows, but I just doesn't work.  I have no idea why...Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
On Error GoTo Err_Get_Data_Click
 
Dim Conn As ADODB.Connection
Set Conn = New ADODB.Connection
 
Dim Cmd As ADODB.Command
Set Cmd = New ADODB.Command
 
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
 
 
Dim strConn As String
Dim strSQL As String
 
strSQL = "SELECT ... " & _
            "FROM ... " & vbCrLf & _
            "Where( " & vbCrLf & _
            "date = TO_DATE('OutDate 00:00:00', 'MM/DD/YYYY HH24:MI:SS') " 
 
txtDate.SetFocus
 
strDate = CStr(txtDate.Text)
 
 
strConn = ("Provider=OraOLEDB.Oracle.1;Password=*****;" & _
            "Persist Security Info=True;User ID=******;Data Source=*********")
            
Conn.ConnectionString = strConn
Conn.Open
 
Cmd.ActiveConnection = Conn
 
strSQL = Replace(strSQL, "OutDate", strDate)
 
Cmd.CommandText = strSQL
 
rs = Cmd.Execute
 
Conn.Close
Set Conn = Nothing
[+][-]05.20.2008 at 02:55AM PDT, ID: 21604635

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.20.2008 at 02:59AM PDT, ID: 21604652

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Access Coding/Macros, Microsoft Access Database, Miscellaneous Programming
Tags: Access 2003, VBA
Sign Up Now!
Solution Provided By: koutny
Participating Experts: 2
Solution Grade: A
 
 
[+][-]05.20.2008 at 03:13AM PDT, ID: 21604701

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.20.2008 at 04:46AM PDT, ID: 21605208

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.20.2008 at 07:02AM PDT, ID: 21606215

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.20.2008 at 07:08AM PDT, ID: 21606265

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.20.2008 at 07:42PM PDT, ID: 21611810

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628