pg.ddx.io pgsql-interfaces@postgresql.org mailing list archive
help / color / mirror / Atom feedOops. Forgot log and source....
2+ messages / 2 participants
[nested] [flat]
* Oops. Forgot log and source....
@ 1999-07-15 11:45 apollo@enigma.net
0 siblings, 0 replies; 2+ messages in thread
From: apollo@enigma.net @ 1999-07-15 11:45 UTC (permalink / raw)
To: pgsql-interfaces
Log:
------------------------------------------------------------------------------
Global Options: Version='06.40.0006', fetch=100, socket=4096,
unknown_sizes=0, max_varchar_size=254, max_longvarchar_size=8190
disable_optimizer=1, ksqo=1, unique_index=1,
use_declarefetch=1
text_as_longvarchar=0, unknowns_as_longvarchar=0,
bools_as_char=0
extra_systable_prefixes='dd_;', conn_settings=''
conn=168376136, query=' '
conn=168376136, query='set DateStyle to 'ISO''
conn=168376136, query='set geqo to 'OFF''
conn=168376136, query='set ksqo to 'ON''
conn=168376136, query='BEGIN'
conn=168376136, query='declare SQL_CUR0A0A0040 cursor for select oid from
pg_type where typname='lo''
conn=168376136, query='fetch 100 in SQL_CUR0A0A0040'
[ fetched 0 rows ]
conn=168376136, query='close SQL_CUR0A0A0040'
conn=168376136, query='END'
conn=168376136,
SQLDriverConnect(out)='DSN=PADUnix;DATABASE=pad;SERVER=betty;PORT=5432;UID=p
ostgres;PWD=;READONLY=0;PROTOCOL=6.4;FAKEOIDINDEX=0;SHOWOIDCOLUMN=0;ROWVERSI
ONING=1;SHOWSYSTEMTABLES=0;CONNSETTINGS='
conn=168376136, query='BEGIN'
conn=168376136, query='DELETE FROM AUDIT_LOG'
conn=168376136, query='COMMIT'
conn=168376136, query='BEGIN'
conn=168376136, query='declare SQL_CUR0A0B0BA0 cursor for SELECT * FROM
AUDIT_LOG'
conn=168376136, query='fetch 100 in SQL_CUR0A0B0BA0'
[ fetched 0 rows ]
conn=168376136, query='declare SQL_CUR0A0D0D40 cursor for select u.usename,
c.relname, a.attname, a.atttypid,t.typname, a.attnum, a.attlen,
a.atttypmod, a.attnotnull from pg_user u, pg_class c, pg_attribute a,
pg_type t where int4out(u.usesysid) = int4out(c.relowner) and c.oid=
a.attrelid and a.atttypid = t.oid and (a.attnum > 0) and c.relname like
'AUDIT_LOG' order by attnum'
conn=168376136, query='fetch 100 in SQL_CUR0A0D0D40'
[ fetched 0 rows ]
conn=168376136, query='close SQL_CUR0A0D0D40'
conn=168376136, query='close SQL_CUR0A0B0BA0'
conn=168376136, query='END'
conn=168376136, SQLDisconnect
Source:
-----------------------------------------------------------------------------
Dim RemoteWK As Workspace
Dim RemoteDB As Database
Dim InRS As Recordset
Dim OutRS As Recordset
Dim Tbl As TableDef
Dim Fld As Field
Dim Cnt As Long
Dim Okay As Boolean
Okay = True
On Error GoTo DBErr
Set RemoteWK = DBEngine.CreateWorkspace("EPAD", "", "", dbUseODBC)
ODBC$ = "ODBC;DSN=PADUnix;DATABASE=pad;SERVER=betty;PORT=5432"
ODBC$ = ODBC$ + ";UID=postgres;PWD=;READONLY=0;PROTOCOL=6.4"
ODBC$ = ODBC$ + ";FAKEOIDINDEX=0;SHOWOIDCOLUMN=0;ROWVERSIONING=1"
ODBC$ = ODBC$ + ";SHOWSYSTEMTABLES=0;CONNSETTINGS="
Set RemoteDB = RemoteWK.OpenDatabase(ODBC$)
For Each Tbl In CurrentDb.TableDefs
If Left$(Tbl.Name, 4) <> "dbo_" And Left$(Tbl.Name, 4) <> "MSys" Then
Debug.Print "Processing " + Tbl.Name + "..."
DoEvents
RemoteDB.Execute "DELETE FROM " + Tbl.Name
Stmt$ = "SELECT * FROM " + Tbl.Name
Set InRS = CurrentDb.OpenRecordset(Stmt$, dbOpenForwardOnly, 0,
dbReadOnly)
Set OutRS = RemoteDB.OpenRecordset(Stmt$, dbOpenDynaset, 0,
dbOptimistic)
Cnt = 0
If Okay Then
Do Until InRS.EOF
OutRS.AddNew ' <----- BREAKS HERE
If Okay = False Then Exit Do
FldCnt% = 1
FldOkay% = False
For Each Fld In Tbl.Fields
If FldCnt% = 1 Then
If (Fld.Attributes And dbAutoIncrField) <>
dbAutoIncrField Then FldOkay% = True
Else
FldOkay% = True
End If
If FldOkay% Then
OutRS.Fields(Fld.Name) = InRS.Fields(Fld.Name)
End If
FldCnt% = FldCnt% + 1
If Okay = False Then Exit For
Next Fld
OutRS.Update
If Okay = False Then Exit Do
InRS.MoveNext
Cnt = Cnt + 1
If Cnt Mod 10 = 0 Then
Debug.Print ".";
DoEvents
End If
If Cnt Mod 100 = 0 Then
Debug.Print
Debug.Print Format$(Cnt);
DoEvents
End If
Loop
OutRS.Close
End If
Debug.Print
InRS.Close
If Okay = False Then Exit For
End If
Next Tbl
RemoteDB.Close
Set RemoteWK = Nothing
On Error GoTo 0
Exit Function
DBErr:
Okay = False
Call DaoErr
Resume Next
^ permalink raw reply [nested|flat] 2+ messages in thread
* RE: [INTERFACES] Oops. Forgot log and source....
@ 1999-07-16 07:25 Ansley, Michael <Michael.Ansley@intec.co.za>
0 siblings, 0 replies; 2+ messages in thread
From: Ansley, Michael @ 1999-07-16 07:25 UTC (permalink / raw)
To: 'apollo@enigma.net' <apollo@enigma.net>; pgsql-interfaces
Check your recordset to make sure that it's not read only, before you try to
insert. If your query joins across tables, sometimes DAO/RDO/ADO gets
upset. Also, if you don't select all the key columns, and also if your open
options are not correct. The thing is, I'm not sure that this is an
updatable query. It may not be, in which case, you can't open an updatable
cursor on it.
MikeA
Try this...
>> Set OutRS = RemoteDB.OpenRecordset(Stmt$, dbOpenDynaset, 0,
dbOptimistic)
>> Cnt = 0
insert>> Okay = Okay And (OutRS.ReadOnly)
>> If Okay Then
>> Do Until InRS.EOF
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~1999-07-16 07:25 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-07-15 11:45 Oops. Forgot log and source.... apollo@enigma.net
1999-07-16 07:25 RE: [INTERFACES] Oops. Forgot log and source.... Ansley, Michael <Michael.Ansley@intec.co.za>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox