Can't get Access Query to Work

  • Thread starter CMeStandingHere
  • Start date
C

CMeStandingHere

The code that I am using is below. No errors are output by the code
and it seems to run correctly. I check the database and nothing has
happened. Any ideas? I usally don't post things but this is becoming
stupid.

Public Shared Sub UpdateModifiedDate(ByVal fl As FileInfo)
Dim Cn As New OleDbConnection

With Cn
.ConnectionString =
"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=x:\AccessDatabase\Limiter.mdb;User Id=admin;Password=;"
.Open()
End With

Dim UpdateCmd As OleDbCommand = New
OleDbCommand("[qryUpdateModifiedDate]", Cn)
With UpdateCmd
.CommandType = CommandType.StoredProcedure
Dim prm As OleDbParameter
prm = New OleDbParameter("CFile_Name",
OleDbType.VarChar)
prm.Value = "'" & fl.Name & "'"
.Parameters.Add(prm)
prm = New OleDbParameter("CFileDateModified",
OleDbType.Date)
prm.Value = fl.LastWriteTime '.ToString
.Parameters.Add(prm)
Try
.ExecuteReader(CommandBehavior.SingleRow)
Catch ex As Exception
Stop
Catch ex As OleDbException
Stop
End Try

End With
Cn.Close()
End Sub
 
C

CMeStandingHere

Nevermind I got it I was creating the parameters in the wrong order.
how dumb is that
 
W

W.G. Ryan MVP

Not dumb at all - I doubt anyone here hasn't done the same thing at least
once ;-)
 

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