Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Visual Dbase > Using SQL UPDAT...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 3 Topic 92 of 130
Post > Topic >>

Using SQL UPDATE statment with ADO

by "Ian Davies" <ian.dandav@[EMAIL PROTECTED] > Apr 12, 2005 at 01:04 PM

Hello VB experts can you help with a problem with my syntax.
With the code below Im trying to update a field called 'Path' in a table
'tSchoolDetails' to 'dlgDialog.filename' (file selected in the common
dialog), I get the following

run-time error '-2147217900 (80040e14)':
Syntax error (missing operator) in query expression
'E:\path\to\database\mydatabase.mdb'.

any help much appreciated
 Ian

Dim adoConn As New ADODB.Connection
    Dim adoCmd As New ADODB.Command
    Dim strConn As String, strSQL As String
    ' Open a Connection object
    strConn = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
    strConn = strConn & dlgDialog.filename
    adoConn.ConnectionString = strConn
    adoConn.Open
    ' Define a query string
    strSQL = "UPDATE tSchoolDetails SET [Path]=" & dlgDialog.filename
    ' Set up the Command object
    adoCmd.CommandText = strSQL
    adoCmd.CommandType = adCmdText
    adoCmd.ActiveConnection = adoConn
    adoCmd.Execute
    ' Tidy up
    Set adoCmd = Nothing
    adoConn.Close
    Set adoConn = Nothing
 




 3 Posts in Topic:
Using SQL UPDATE statment with ADO
"Ian Davies" &l  2005-04-12 13:04:36 
Re: Using SQL UPDATE statment with ADO
"David Hodgkins"  2005-04-12 08:33:32 
Re: Using SQL UPDATE statment with ADO
"Ian Davies" &l  2005-04-12 15:14:51 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan13V112 Wed Jul 9 2:07:07 CDT 2008.