openconnection og workspace access 2007
Hej eksperterPå mit arbejde skal vi skifte fra access 2003 til 2007 og følgende kode virkede fint i 2003 men ikke i 2007:
Dim ws As Workspace
Dim DB As Connection
Dim rst As Recordset, rst2 As Recordset, rst3 As Recordset, rst4 As Recordset
Set ws = CreateWorkspace("FK", "", "", dbUseODBC)
Workspaces.Append ws
Set DB = ws.OpenConnection("FK", dbDriverNoPrompt, False, "ODBC;DSN=SCDRAPADM;UID=SASADMIN;PWD=abc123")
Set rst = DB.OpenRecordset("select max(jobnr) as max from ondemand_ondemand")
With rst
JOBNR = !Max + 1
.Close
End With
Job.Value = JOBNR
sqlJobSpec = "insert into OnDemand_OnDemand(jobnr,BNR,txt1,txt2,status,maxrc ,DT_0) values (" & JOBNR & ", '" & BNR.Value & _
"', '%inc ODPROG(" & OD_Prog & ");', '" & UCase(PORCALC.Value) & "' , 0, 0, SYSDATE)"
DB.Execute sqlJobSpec, dbExecDirect
Jeg kunne virkelig godt bruge hjælp til at få det til at virke i 2007, da vi har mange af disse funktioner :-(
Giver gerne flere end 200 point for hjælp til dette!