Thread: Create index in PG table with vb6
Hi, I am using the following to write data from an access table to a postgres table. I need to create an index on the "partnumber" field in the Bpb (odbc pg database) so I can seek on that field. Need to be able to locate and update records that already exist in the postgres table. It appears that the "partnumber" field is a memo field. Thanks, Dan Dim Pricebooks As dao.Database Dim PGDB As dao.Database Dim WrkSpc As Workspace Dim Bonneville As String Dim Apb As Recordset Dim Bpb As Recordset Dim PBSelection As String Dim i As Integer Bonneville = "DSN=PostgreSQL30;DATABASE=bonneville;UID=postgres;PWD=postgres" 'Open Access table. Set Pricebooks = OpenDatabase(App.Path & "\Pricebooks.mdb") Set Apb = Pricebooks.OpenRecordset("pricebook", dbOpenTable) 'Open Postgres table Set WrkSpc = DBEngine.Workspaces(0) Set PGDB = WrkSpc.OpenDatabase("", False, False, Bonneville) Set Bpb = PGDB.OpenRecordset("public.papricebook", dbOpenDynaset)
--- DanPerlman <dan@dpci.us> wrote: > Hi, > > I am using the following to write data from an > access table to a postgres > table. > I need to create an index on the __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com
Hmm, looks like Yahoo crapped out on me and failed to send the text of my reply (that's my story and I'm sticking to it ;-) ). Trying again: Sounds like your problem field is type text, and your ODBC driver setting for "Text As LongVarChar" is "true". Access will see the field as "memo" type in that case, and therefore not indexable or searchable. You could redefine your field as varchar, or unset the driver option, though that will mean a size limitation on your fields. --- Jeff Eckermann <jeff_eckermann@yahoo.com> wrote: > --- DanPerlman <dan@dpci.us> wrote: > > Hi, > > > > I am using the following to write data from an > > access table to a postgres > > table. > > I need to create an index on the > > __________________________________ > Do you Yahoo!? > Yahoo! SiteBuilder - Free, easy-to-use web site > design software > http://sitebuilder.yahoo.com > > ---------------------------(end of > broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org __________________________________ Do you Yahoo!? Yahoo! SiteBuilder - Free, easy-to-use web site design software http://sitebuilder.yahoo.com