Posted by RS200Phil on 10/05/06 11:29
Thanks for the prompt reply Erland.
The database is opened as follows:
..
..
..
lsConnectionString = "ODBC;Description=SQL Server 2k;DRIVER=SQL
Server;SERVER=SERVER;UID=Administrator;" & _
"APP=??????;WSID=PII333;DATABASE=Sparc;Network=DBNMPNTW;QueryLog_On=Yes;
Trusted_Connection=Yes"
Set gdbSparc = DBEngine.Workspaces(0).OpenDatabase("", dbDriverNoPrompt,
False, lsConnectionString)
..
..
..
(Sorry for line confusion, hope this makes sense!).
The function that would build the indexes contains the following code.
lsSQL = "ALTER TABLE " & lsTable & " " & _
"ADD CONSTRAINT PK_" & lsTable & " PRIMARY KEY CLUSTERED " & _
"([PhoneNo]) On [PRIMARY];"
gdbSparc.Execute lsSQL
This translates to the code I posted previously when the "lsTable"
parameter is provided (e.g. [ClientTable]).
I pasted the code by printing the value of <lsSQL> in the debug window
and copying it from there.
HTH
Phil
*** Sent via Developersdex http://www.developersdex.com ***
[Back to original message]
|