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 > Re: Using SQL U...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 3 Topic 92 of 132
Post > Topic >>

Re: Using SQL UPDATE statment with ADO

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

Thanks to all of you, that worked

Ian

"Ian Davies" <ian.dandav@[EMAIL PROTECTED]
> wrote in message
news:EHP6e.21952$vv2.12700@[EMAIL PROTECTED]
> 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
tan12V112 Sat Nov 22 10:57:14 CST 2008.