X-Original-To: pgsql-odbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 7B0EF9DC9B6 for ; Wed, 11 Jan 2006 13:18:48 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 19590-08 for ; Wed, 11 Jan 2006 13:18:46 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from imf24aec.mail.bellsouth.net (imf24aec.mail.bellsouth.net [205.152.59.72]) by postgresql.org (Postfix) with ESMTP id B4ACB9DC9A5 for ; Wed, 11 Jan 2006 13:18:45 -0400 (AST) Received: from ibm70aec.bellsouth.net ([70.146.185.222]) by imf24aec.mail.bellsouth.net with ESMTP id <20060111171845.IPFH14434.imf24aec.mail.bellsouth.net@ibm70aec.bellsouth.net> for ; Wed, 11 Jan 2006 12:18:45 -0500 Received: from [192.168.1.46] (really [70.146.185.222]) by ibm70aec.bellsouth.net with ESMTP id <20060111171845.OZNO26589.ibm70aec.bellsouth.net@[192.168.1.46]>; Wed, 11 Jan 2006 12:18:45 -0500 Message-ID: <43C53DED.3080809@gmail.com> Date: Wed, 11 Jan 2006 11:18:37 -0600 From: Adam Biser User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Ludek Finstrle CC: pgsql-odbc@postgresql.org Subject: Re: Parameters.Refresh error. References: <43BAD33D.1000302@gmail.com> <20060106084609.GA7100@soptik.pzkagis.cz> <43BECB1E.4090509@gmail.com> <20060108112440.GB25406@soptik.pzkagis.cz> <43C15432.1060509@gmail.com> <20060110171355.GC7443@soptik.pzkagis.cz> In-Reply-To: <20060110171355.GC7443@soptik.pzkagis.cz> Content-Type: multipart/mixed; boundary="------------030205070201060909010901" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.1 required=5 tests=[AWL=0.100] X-Spam-Score: 0.1 X-Spam-Level: X-Archive-Number: 200601/114 X-Sequence-Number: 6929 This is a multi-part message in MIME format. --------------030205070201060909010901 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit > What's happen? I can't continue helping you without it. Sorry this is later than expected, things got a bit around here. I attached the code so that spacing is preserved. It's in VB6 and just a text file. The first method works, but none of the others do. I've made note of the error I receive as comments in the code. If there's anything else you need, just let me know. Thank you, Adam --------------030205070201060909010901 Content-Type: text/plain; name="pgsql-parms.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="pgsql-parms.txt" Dim dbc As ADODB.Connection Dim cmd As ADODB.Command Set dbc = New ADODB.Connection dbc.Open "DSN=GALSTA Postgres;", UserID, Password ' Verify that the connection opened properly. If dbc.State And adStateOpen Then Debug.Print "Connected" ' This method works. ' dbc.Execute "Insert into CHAPTER (CHAPTERID, CHAPTERDESC) values (1,'test1')" ' Start the second method. Set cmd = New ADODB.Command Set cmd.ActiveConnection = dbc cmd.CommandText = "Insert into CHAPTER (CHAPTERID, CHAPTERDESC) values (?,?)" ' Error on next line: Provider cannot derive parameter information and SetParameterInfo has not been called. cmd.Parameters.Refresh cmd.Parameters.Item(0).Value = 2 cmd.Parameters.Item(1).Value = "test2" cmd.Execute Set cmd = Nothing ' Start the third method. Set cmd = New ADODB.Command Set cmd.ActiveConnection = dbc cmd.CommandText = "Insert into CHAPTER (CHAPTERID, CHAPTERDESC) values (?,?)" Call cmd.Parameters.Append(cmd.CreateParameter("ID", adNumeric, adParamInput, 4)) Call cmd.Parameters.Append(cmd.CreateParameter("DESC", adVarChar, adParamInput, 80)) cmd.Parameters.Item(0).Value = 3 cmd.Parameters.Item(1).Value = "test3" ' Error on next line: Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done. cmd.Execute Set cmd = Nothing ' Start the fourth method. Set cmd = New ADODB.Command Set cmd.ActiveConnection = dbc cmd.CommandText = "Insert into CHAPTER (CHAPTERID, CHAPTERDESC) values (?,?)" Call cmd.Parameters.Append(cmd.CreateParameter("ID", adNumeric, adParamInput, 4, 4)) Call cmd.Parameters.Append(cmd.CreateParameter("DESC", adVarChar, adParamInput, 80, "test4")) ' Next line produces the same error as the third method. cmd.Execute Set cmd = Nothing ' Done dbc.Close End If Set dbc = Nothing --------------030205070201060909010901--