Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What is the problem in my codes?

Status
Not open for further replies.

ii128

Programmer
May 18, 2001
129
US
What is the problem in my codes?


Set cmd = New ADODB.Command
Set rsRate = New ADODB.Recordset
If cn.State = adStateClosed Then
cn.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Dod\DOD.mdb"
cn.Open
End If

cmd.ActiveConnection = cn
cmd.CommandText = "select * from information"
cmd.CommandType = adCmdText

rsRate.Open cmd
rsRate.AddNew
 
Try this:
[tt]
cmd.ActiveConnection = cn
cmd.CommandText = "select * from information"
cmd.CommandType = adCmdText

set rsRate = cmd.Open
[/tt]

 
Whoops - cut & paste error:

Last line should be:

set rsRate = cmd.Execute

Chip H.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top