SQL Hel---p

G

Guest

I need some help!!
Can someone look at this and tell me what I am doing wrong.
I am trying lookup a value in a table based on to form-field values and
return the result to a particular form-field. If I dun the query in access
and manually provide “parameters†the query runs and always returns one
record with one value (as expected).

The query also runs in VB if a manually use “generic values†but fails when
I use declared from-field values. Clearly, I am doing something wrong.
Also, I do not know how to return the result to a form field.


Private Sub cmdTest_Click()

'Delcare and instantiate one connection object and record set
Dim rst1 As New ADODB.Recordset
Dim cmd As New ADODB.Command

'Delcare form feild values
Dim recID As Object
Dim optionID As Object
Dim rlAmount As Object
Dim optionLTV As Object

' var for SQL text
Dim cmdTxt As Variant


'Set Feild Values needed for SQL statement
Set optionID = Me.fkOptionsMatrixID
Set rlAmount = Me.ReqLoanAmount

'Set Prim Key for current record in form
Set recID = Me.LoanID

'Set current "LTV Limit" value.
'This value will be updated with SQL result
Set optionLTV = Me.LtvLimit


'cmd string
cmdTxt = "SELECT tLTVm.fkOptionsMatrixId, tLTVm.LtvLimit " & _
"FROM tblLtvMatrix AS tLTVm " & _
"WHERE ((fkOptionsMatrixId = (optionID)) " & _
"AND (LowerLimit <= rlAmount) " & _
"AND (UpperLimit >= rlAmount));"



' Make sure an option value has been selected and a loan amount is entered.
If optionID.Value < 1 Or rlAmount.Value <= 0 Then
Exit Sub
Else 'Run SQL statement
cmd.ActiveConnection = CurrentProject.Connection
cmd.CommandText = cmdTxt
Set rst1 = cmd.Execute

'Next line Just for testing
Debug.Print rst1.GetString
'**** Need code to return SQL result to "optionLTV"
(Me.fkOptionsMatrixID)


'**** Need to refresh "Form Data" (Me.fkOptionsMatrixID is used to
calculate values in underling record set for form)

'Clean-up
rst1.Close
Set rst1 = Nothing
Set cmd = Nothing

End If
 
D

Dan Artuso

Hi,
You have to let Access evaluate your variables and concatenate them
onto your statement. Try something like this:

cmdTxt = "SELECT tLTVm.fkOptionsMatrixId, tLTVm.LtvLimit " & _
"FROM tblLtvMatrix AS tLTVm " & _
"WHERE ((fkOptionsMatrixId = (" & optionID & ")) " & _
"AND (LowerLimit <= " & rlAmount & ") " & _
"AND (UpperLimit >= " & rlAmount & "));"

I've treated the values as numeric. Strings require quotes as delimiters
(LowerLimit <= '" & rlAmount & "') " & _

dates require #
LowerLimit <= #" & rlAmount & "#) " & _
 
G

Guest

THANK YOU

I have been trying to figure this out for 3 days. Access does not provide
much help for SQL in VB.

Can you help me with the second part of my question? How do I return the
result to the Form-Field (e.g.: optionTLV = 'SQL Result'). Keep in mind
that the query always return only one value for one record.

THANKS AGAIN for your help
 
G

Guest

errata:
When I run the code with your corrections, the immediate window returns two
values, 67 and 0.75, respectively. The first value is the "fkOptionMatrixID"
field value but I need the second value (0.75 in this case) returned to
"optionLTV" (ultimately, Me.LtvLimit).
 
D

Dan Artuso

Hi,
You've lost me. I have no idea what you mean by that.

AS far as getting values...
Once your recordset is open you can access the values like this:
Hmmm... just noticed you're not using a recordset!

Okay...

Dim rs as DAO.Recordset

Set rs = CurrentDb.OpenRecordset(cmdTxt)
optionTLV = rs!LtvLimit

In general, you are selecting two fields from the table:
rs!LtvLimit and
rs!fkOptionsMatrixId

is how you access the values.
Make sense?
 
G

Guest

Actually, I did declare a new ADOBD.Recordset at the beginning of my code
(Dim rst1 as New ADODB.RecordSet). So will this work?

Set rst1 = CurrentDb.OpenRecordset(cmdTxt)
optionTLV = rst1!LtvLimit
 
D

Dan Artuso

Hi,
Not an ADODB recordset but a DAO recordset.
I find them easier to work with in Access.

As too whether it will work... try it!
Or post your code so we can take a look at it if it's not working.

If it's not working please post any error messages and also the line of code
on which it failed.
 
G

Guest

I went ahead and stuck with the ADO object. Most of my books lean more
towards ADO and refer to DOA in the past tense. As you probably realize, I
do not have much experience in writing VBA for Access and BOOKS help. I have
developed some Excel application with VBA but things are very different in
"flat-land" (no SQL there). Anyway, all I had to do was to add Me.LtvLimit
= rst1.fields![LtvLimit}", PROBLEM SOLVED.

I should have realized that I needed to concatenate my variables in the SQL
Cmd.CommandText. It seem so obvious now. (always does)

DAN, Thanks for taking the time to help. i am sure I would still be
overlooking the obvious without your help. It's not much BUT THANKS. Have a
great weekend!
 
D

Douglas J. Steele

ADO is obsolete, having been supplanted by ADO.Net.

While DAO isn't getting new features, it's still the preferred way to access
Jet databases.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Enohp Aikon said:
I went ahead and stuck with the ADO object. Most of my books lean more
towards ADO and refer to DOA in the past tense. As you probably realize, I
do not have much experience in writing VBA for Access and BOOKS help. I have
developed some Excel application with VBA but things are very different in
"flat-land" (no SQL there). Anyway, all I had to do was to add Me.LtvLimit
= rst1.fields![LtvLimit}", PROBLEM SOLVED.

I should have realized that I needed to concatenate my variables in the SQL
Cmd.CommandText. It seem so obvious now. (always does)

DAN, Thanks for taking the time to help. i am sure I would still be
overlooking the obvious without your help. It's not much BUT THANKS. Have a
great weekend!

Dan Artuso said:
Hi,
Not an ADODB recordset but a DAO recordset.
I find them easier to work with in Access.

As too whether it will work... try it!
Or post your code so we can take a look at it if it's not working.

If it's not working please post any error messages and also the line of code
on which it failed.

--
HTH
-------
Dan Artuso, MVP


message
 
G

Guest

I appreciate the info and it raises new issues for me to consider (and
question). The application I am building is merely a prototype. At some
point, it will be converted (by others) into a SQL-Server 2000 application.
We may have to use the Access (2003) as a front-end for a while but
eventually the inteerface will become “browser-basedâ€. I have already
started the application using ADO but I can convert things over to DOA if I
should. One thing for certain, I want to use one ore the other, not both.

Based on the information above, what do you guys recommend? I am not a
developer but I have enough skills to get buy. All I have to do is create a
working model. After that, it will be handed off to our application
development team for them to build the final application.


Douglas J. Steele said:
ADO is obsolete, having been supplanted by ADO.Net.

While DAO isn't getting new features, it's still the preferred way to access
Jet databases.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Enohp Aikon said:
I went ahead and stuck with the ADO object. Most of my books lean more
towards ADO and refer to DOA in the past tense. As you probably realize, I
do not have much experience in writing VBA for Access and BOOKS help. I have
developed some Excel application with VBA but things are very different in
"flat-land" (no SQL there). Anyway, all I had to do was to add Me.LtvLimit
= rst1.fields![LtvLimit}", PROBLEM SOLVED.

I should have realized that I needed to concatenate my variables in the SQL
Cmd.CommandText. It seem so obvious now. (always does)

DAN, Thanks for taking the time to help. i am sure I would still be
overlooking the obvious without your help. It's not much BUT THANKS. Have a
great weekend!

Dan Artuso said:
Hi,
Not an ADODB recordset but a DAO recordset.
I find them easier to work with in Access.

As too whether it will work... try it!
Or post your code so we can take a look at it if it's not working.

If it's not working please post any error messages and also the line of code
on which it failed.

--
HTH
-------
Dan Artuso, MVP


Actually, I did declare a new ADOBD.Recordset at the beginning of my code
(Dim rst1 as New ADODB.RecordSet). So will this work?

Set rst1 = CurrentDb.OpenRecordset(cmdTxt)
optionTLV = rst1!LtvLimit

:

Hi,
You've lost me. I have no idea what you mean by that.

AS far as getting values...
Once your recordset is open you can access the values like this:
Hmmm... just noticed you're not using a recordset!

Okay...

Dim rs as DAO.Recordset

Set rs = CurrentDb.OpenRecordset(cmdTxt)
optionTLV = rs!LtvLimit

In general, you are selecting two fields from the table:
rs!LtvLimit and
rs!fkOptionsMatrixId

is how you access the values.
Make sense?

--
HTH
-------
Dan Artuso, MVP


errata:
When I run the code with your corrections, the immediate window returns two
values, 67 and 0.75, respectively. The first value is the "fkOptionMatrixID"
field value but I need the second value (0.75 in this case) returned to
"optionLTV" (ultimately, Me.LtvLimit).

:

THANK YOU

I have been trying to figure this out for 3 days. Access does not provide
much help for SQL in VB.

Can you help me with the second part of my question? How do I return the
result to the Form-Field (e.g.: optionTLV = 'SQL Result'). Keep in mind
that the query always return only one value for one record.

THANKS AGAIN for your help

:

Hi,
You have to let Access evaluate your variables and concatenate them
onto your statement. Try something like this:

cmdTxt = "SELECT tLTVm.fkOptionsMatrixId, tLTVm.LtvLimit " & _
"FROM tblLtvMatrix AS tLTVm " & _
"WHERE ((fkOptionsMatrixId = (" & optionID & ")) " & _
"AND (LowerLimit <= " & rlAmount & ") " & _
"AND (UpperLimit >= " & rlAmount & "));"

I've treated the values as numeric. Strings require quotes as delimiters
(LowerLimit <= '" & rlAmount & "') " & _

dates require #
LowerLimit <= #" & rlAmount & "#) " & _

--
HTH
Dan Artuso, Access MVP


I need some help!!
Can someone look at this and tell me what I am doing wrong.
I am trying lookup a value in a table based on to form-field values and
return the result to a particular form-field. If I dun the query in access
and manually provide "parameters" the query runs and always returns one
record with one value (as expected).

The query also runs in VB if a manually use "generic values" but fails when
I use declared from-field values. Clearly, I am doing something wrong.
Also, I do not know how to return the result to a form field.


Private Sub cmdTest_Click()

'Delcare and instantiate one connection object and record set
Dim rst1 As New ADODB.Recordset
Dim cmd As New ADODB.Command

'Delcare form feild values
Dim recID As Object
Dim optionID As Object
Dim rlAmount As Object
Dim optionLTV As Object

' var for SQL text
Dim cmdTxt As Variant


'Set Feild Values needed for SQL statement
Set optionID = Me.fkOptionsMatrixID
Set rlAmount = Me.ReqLoanAmount

'Set Prim Key for current record in form
Set recID = Me.LoanID

'Set current "LTV Limit" value.
'This value will be updated with SQL result
Set optionLTV = Me.LtvLimit


'cmd string
cmdTxt = "SELECT tLTVm.fkOptionsMatrixId, tLTVm.LtvLimit " & _
"FROM tblLtvMatrix AS tLTVm " & _
"WHERE ((fkOptionsMatrixId = (optionID)) " & _
"AND (LowerLimit <= rlAmount) " & _
"AND (UpperLimit >= rlAmount));"



' Make sure an option value has been selected and a loan amount is entered.
If optionID.Value < 1 Or rlAmount.Value <= 0 Then
Exit Sub
Else 'Run SQL statement
cmd.ActiveConnection = CurrentProject.Connection
cmd.CommandText = cmdTxt
Set rst1 = cmd.Execute

'Next line Just for testing
Debug.Print rst1.GetString
'**** Need code to return SQL result to "optionLTV"
(Me.fkOptionsMatrixID)


'**** Need to refresh "Form Data" (Me.fkOptionsMatrixID is used to
calculate values in underling record set for form)

'Clean-up
rst1.Close
Set rst1 = Nothing
Set cmd = Nothing

End If
 
D

Douglas J. Steele

If you're planning on moving to SQL Server, then you probably do want to
move away from DAO. I don't believe that Access can use ADO.Net, so ADO
would be your best bet.

OTOH, there's nothing wrong with having both: I do it all the time when I
need to query tables in my MDB as well as in SQL Server.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Enohp Aikon said:
I appreciate the info and it raises new issues for me to consider (and
question). The application I am building is merely a prototype. At some
point, it will be converted (by others) into a SQL-Server 2000 application.
We may have to use the Access (2003) as a front-end for a while but
eventually the inteerface will become "browser-based". I have already
started the application using ADO but I can convert things over to DOA if I
should. One thing for certain, I want to use one ore the other, not both.

Based on the information above, what do you guys recommend? I am not a
developer but I have enough skills to get buy. All I have to do is create a
working model. After that, it will be handed off to our application
development team for them to build the final application.


Douglas J. Steele said:
ADO is obsolete, having been supplanted by ADO.Net.

While DAO isn't getting new features, it's still the preferred way to access
Jet databases.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Enohp Aikon said:
I went ahead and stuck with the ADO object. Most of my books lean more
towards ADO and refer to DOA in the past tense. As you probably
realize,
I
do not have much experience in writing VBA for Access and BOOKS help.
I
have
developed some Excel application with VBA but things are very different in
"flat-land" (no SQL there). Anyway, all I had to do was to add Me.LtvLimit
= rst1.fields![LtvLimit}", PROBLEM SOLVED.

I should have realized that I needed to concatenate my variables in
the
SQL
Cmd.CommandText. It seem so obvious now. (always does)

DAN, Thanks for taking the time to help. i am sure I would still be
overlooking the obvious without your help. It's not much BUT THANKS. Have a
great weekend!

:

Hi,
Not an ADODB recordset but a DAO recordset.
I find them easier to work with in Access.

As too whether it will work... try it!
Or post your code so we can take a look at it if it's not working.

If it's not working please post any error messages and also the line
of
code
on which it failed.

--
HTH
-------
Dan Artuso, MVP


"Enohp Aikon" <[email protected]> wrote in
message
Actually, I did declare a new ADOBD.Recordset at the beginning of
my
code
(Dim rst1 as New ADODB.RecordSet). So will this work?

Set rst1 = CurrentDb.OpenRecordset(cmdTxt)
optionTLV = rst1!LtvLimit

:

Hi,
You've lost me. I have no idea what you mean by that.

AS far as getting values...
Once your recordset is open you can access the values like this:
Hmmm... just noticed you're not using a recordset!

Okay...

Dim rs as DAO.Recordset

Set rs = CurrentDb.OpenRecordset(cmdTxt)
optionTLV = rs!LtvLimit

In general, you are selecting two fields from the table:
rs!LtvLimit and
rs!fkOptionsMatrixId

is how you access the values.
Make sense?

--
HTH
-------
Dan Artuso, MVP


errata:
When I run the code with your corrections, the immediate
window
returns two
values, 67 and 0.75, respectively. The first value is the "fkOptionMatrixID"
field value but I need the second value (0.75 in this case) returned to
"optionLTV" (ultimately, Me.LtvLimit).

:

THANK YOU

I have been trying to figure this out for 3 days. Access
does
not provide
much help for SQL in VB.

Can you help me with the second part of my question? How do
I
return the
result to the Form-Field (e.g.: optionTLV = 'SQL Result'). Keep in mind
that the query always return only one value for one record.

THANKS AGAIN for your help

:

Hi,
You have to let Access evaluate your variables and
concatenate
them
onto your statement. Try something like this:

cmdTxt = "SELECT tLTVm.fkOptionsMatrixId, tLTVm.LtvLimit " & _
"FROM tblLtvMatrix AS tLTVm " & _
"WHERE ((fkOptionsMatrixId = (" & optionID & "))
" &
_
"AND (LowerLimit <= " & rlAmount & ") " & _
"AND (UpperLimit >= " & rlAmount & "));"

I've treated the values as numeric. Strings require quotes
as
delimiters
(LowerLimit <= '" & rlAmount & "') " & _

dates require #
LowerLimit <= #" & rlAmount & "#) " & _

--
HTH
Dan Artuso, Access MVP


"Enohp Aikon" <[email protected]> wrote
in
message
I need some help!!
Can someone look at this and tell me what I am doing wrong.
I am trying lookup a value in a table based on to
form-field
values and
return the result to a particular form-field. If I dun
the
query in access
and manually provide "parameters" the query runs and
always
returns one
record with one value (as expected).

The query also runs in VB if a manually use "generic
values"
but fails when
I use declared from-field values. Clearly, I am doing something wrong.
Also, I do not know how to return the result to a form field.


Private Sub cmdTest_Click()

'Delcare and instantiate one connection object and
record
set
Dim rst1 As New ADODB.Recordset
Dim cmd As New ADODB.Command

'Delcare form feild values
Dim recID As Object
Dim optionID As Object
Dim rlAmount As Object
Dim optionLTV As Object

' var for SQL text
Dim cmdTxt As Variant


'Set Feild Values needed for SQL statement
Set optionID = Me.fkOptionsMatrixID
Set rlAmount = Me.ReqLoanAmount

'Set Prim Key for current record in form
Set recID = Me.LoanID

'Set current "LTV Limit" value.
'This value will be updated with SQL result
Set optionLTV = Me.LtvLimit


'cmd string
cmdTxt = "SELECT tLTVm.fkOptionsMatrixId,
tLTVm.LtvLimit "
& _
"FROM tblLtvMatrix AS tLTVm " & _
"WHERE ((fkOptionsMatrixId = (optionID)) " & _
"AND (LowerLimit <= rlAmount) " & _
"AND (UpperLimit >= rlAmount));"



' Make sure an option value has been selected and a
loan
amount is entered.
If optionID.Value < 1 Or rlAmount.Value <= 0 Then
Exit Sub
Else 'Run SQL statement
cmd.ActiveConnection = CurrentProject.Connection
cmd.CommandText = cmdTxt
Set rst1 = cmd.Execute

'Next line Just for testing
Debug.Print rst1.GetString
'**** Need code to return SQL result to "optionLTV"
(Me.fkOptionsMatrixID)


'**** Need to refresh "Form Data"
(Me.fkOptionsMatrixID is used to
calculate values in underling record set for form)

'Clean-up
rst1.Close
Set rst1 = Nothing
Set cmd = Nothing

End If
 
G

Guest

Thanks Doug for the recomendations and information. And additional Thanks to
Dan for his help regarding my SQL needs.

Douglas J. Steele said:
If you're planning on moving to SQL Server, then you probably do want to
move away from DAO. I don't believe that Access can use ADO.Net, so ADO
would be your best bet.

OTOH, there's nothing wrong with having both: I do it all the time when I
need to query tables in my MDB as well as in SQL Server.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



Enohp Aikon said:
I appreciate the info and it raises new issues for me to consider (and
question). The application I am building is merely a prototype. At some
point, it will be converted (by others) into a SQL-Server 2000 application.
We may have to use the Access (2003) as a front-end for a while but
eventually the inteerface will become "browser-based". I have already
started the application using ADO but I can convert things over to DOA if I
should. One thing for certain, I want to use one ore the other, not both.

Based on the information above, what do you guys recommend? I am not a
developer but I have enough skills to get buy. All I have to do is create a
working model. After that, it will be handed off to our application
development team for them to build the final application.


Douglas J. Steele said:
ADO is obsolete, having been supplanted by ADO.Net.

While DAO isn't getting new features, it's still the preferred way to access
Jet databases.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)



I went ahead and stuck with the ADO object. Most of my books lean more
towards ADO and refer to DOA in the past tense. As you probably realize,
I
do not have much experience in writing VBA for Access and BOOKS help. I
have
developed some Excel application with VBA but things are very different in
"flat-land" (no SQL there). Anyway, all I had to do was to add
Me.LtvLimit
= rst1.fields![LtvLimit}", PROBLEM SOLVED.

I should have realized that I needed to concatenate my variables in the
SQL
Cmd.CommandText. It seem so obvious now. (always does)

DAN, Thanks for taking the time to help. i am sure I would still be
overlooking the obvious without your help. It's not much BUT THANKS.
Have a
great weekend!

:

Hi,
Not an ADODB recordset but a DAO recordset.
I find them easier to work with in Access.

As too whether it will work... try it!
Or post your code so we can take a look at it if it's not working.

If it's not working please post any error messages and also the line of
code
on which it failed.

--
HTH
-------
Dan Artuso, MVP


Actually, I did declare a new ADOBD.Recordset at the beginning of my
code
(Dim rst1 as New ADODB.RecordSet). So will this work?

Set rst1 = CurrentDb.OpenRecordset(cmdTxt)
optionTLV = rst1!LtvLimit

:

Hi,
You've lost me. I have no idea what you mean by that.

AS far as getting values...
Once your recordset is open you can access the values like this:
Hmmm... just noticed you're not using a recordset!

Okay...

Dim rs as DAO.Recordset

Set rs = CurrentDb.OpenRecordset(cmdTxt)
optionTLV = rs!LtvLimit

In general, you are selecting two fields from the table:
rs!LtvLimit and
rs!fkOptionsMatrixId

is how you access the values.
Make sense?

--
HTH
-------
Dan Artuso, MVP


message
errata:
When I run the code with your corrections, the immediate window
returns two
values, 67 and 0.75, respectively. The first value is the
"fkOptionMatrixID"
field value but I need the second value (0.75 in this case)
returned to
"optionLTV" (ultimately, Me.LtvLimit).

:

THANK YOU

I have been trying to figure this out for 3 days. Access does
not provide
much help for SQL in VB.

Can you help me with the second part of my question? How do I
return the
result to the Form-Field (e.g.: optionTLV = 'SQL Result').
Keep in mind
that the query always return only one value for one record.

THANKS AGAIN for your help

:

Hi,
You have to let Access evaluate your variables and concatenate
them
onto your statement. Try something like this:

cmdTxt = "SELECT tLTVm.fkOptionsMatrixId, tLTVm.LtvLimit " & _
"FROM tblLtvMatrix AS tLTVm " & _
"WHERE ((fkOptionsMatrixId = (" & optionID & ")) " &
_
"AND (LowerLimit <= " & rlAmount & ") " & _
"AND (UpperLimit >= " & rlAmount & "));"

I've treated the values as numeric. Strings require quotes as
delimiters
(LowerLimit <= '" & rlAmount & "') " & _

dates require #
LowerLimit <= #" & rlAmount & "#) " & _

--
HTH
Dan Artuso, Access MVP


message
I need some help!!
Can someone look at this and tell me what I am doing wrong.
I am trying lookup a value in a table based on to form-field
values and
return the result to a particular form-field. If I dun the
query in access
and manually provide "parameters" the query runs and always
returns one
record with one value (as expected).

The query also runs in VB if a manually use "generic values"
but fails when
I use declared from-field values. Clearly, I am doing
something wrong.
Also, I do not know how to return the result to a form
field.


Private Sub cmdTest_Click()

'Delcare and instantiate one connection object and record
set
Dim rst1 As New ADODB.Recordset
Dim cmd As New ADODB.Command

'Delcare form feild values
Dim recID As Object
Dim optionID As Object
Dim rlAmount As Object
Dim optionLTV As Object

' var for SQL text
Dim cmdTxt As Variant


'Set Feild Values needed for SQL statement
Set optionID = Me.fkOptionsMatrixID
Set rlAmount = Me.ReqLoanAmount

'Set Prim Key for current record in form
Set recID = Me.LoanID

'Set current "LTV Limit" value.
'This value will be updated with SQL result
Set optionLTV = Me.LtvLimit


'cmd string
cmdTxt = "SELECT tLTVm.fkOptionsMatrixId, tLTVm.LtvLimit "
& _
"FROM tblLtvMatrix AS tLTVm " & _
"WHERE ((fkOptionsMatrixId = (optionID)) " & _
"AND (LowerLimit <= rlAmount) " & _
"AND (UpperLimit >= rlAmount));"



' Make sure an option value has been selected and a loan
amount is entered.
If optionID.Value < 1 Or rlAmount.Value <= 0 Then
Exit Sub
Else 'Run SQL statement
cmd.ActiveConnection = CurrentProject.Connection
cmd.CommandText = cmdTxt
Set rst1 = cmd.Execute

'Next line Just for testing
Debug.Print rst1.GetString
'**** Need code to return SQL result to "optionLTV"
(Me.fkOptionsMatrixID)


'**** Need to refresh "Form Data"
(Me.fkOptionsMatrixID is used to
calculate values in underling record set for form)

'Clean-up
rst1.Close
Set rst1 = Nothing
Set cmd = Nothing

End If
 
J

Jamie Collins

Douglas J. Steele said:
ADO is obsolete ...

I'm not sure that's correct. ADO still ships with MDAC (unlike DAO and
Jet).
... having been supplanted by ADO.Net.

I'm not use that's correct. ADO.NET can only be used with managed
code. We still need ADO classic for COM based code e.g. VBA.
While DAO isn't getting new features, it's still the preferred way to access
Jet databases.

Preferred by those whose users whose DAO knowledge predates ADO
itself, perhaps <g>. I agree with the OP, most newcomers choose ADO:
if you have to learn one, best to go for the one that has wider
application. Also, the newer features of Jet (CHECK constraints,
CREATE PROCEDURE syntax, etc) are only accessible via ADO.

Jamie.

--
 

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