MartyConnelly
martyconnelly at shaw.ca
Sun Jul 16 19:41:25 CDT 2006
There were some service pack changes Office 2003 SP2 to acwizmain.mde. I doubt if it was this, http://support.microsoft.com/kb/821549 However if you just need a random query name why not just create a GUID string 'Paul Brower - 02152001 Private Const RPC_S_OK As Long = 0& Private Const RPC_S_UUID_LOCAL_ONLY As Long = 1824& Private Const RPC_S_UUID_NO_ADDRESS As Long = 1739& Private Type GUID Data1 As Long Data2 As Integer Data3 As Integer Data4(7) As Byte End Type Private Declare Function UuidCreate& Lib "rpcrt4" (lpGUID As GUID) Private Declare Function UuidToString& Lib "rpcrt4" Alias "UuidToStringA" (lpGUID As GUID, lpGUIDString&) Private Declare Function RpcStringFree& Lib "rpcrt4" Alias "RpcStringFreeA" (lpGUIDString&) Private Declare Function lstrlen& Lib "kernel32" Alias "lstrlenA" (ByVal lpString&) Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (lpDest As Any, lpSource As Any, ByVal cBytes&) Public Function CreateGUID() As String 'More GUID routines here ' http://www.trigeminal.com/code/guids.bas Dim nGUID As GUID, lpStrGUID&, nStrLen&, sGUID$ Dim sBuffer() As Byte, bNoError As Boolean If UuidCreate(nGUID) <> RPC_S_UUID_NO_ADDRESS Then If UuidToString(nGUID, lpStrGUID) = RPC_S_OK Then nStrLen = lstrlen(lpStrGUID) ReDim sBuffer(nStrLen - 1) As Byte CopyMemory sBuffer(0), ByVal lpStrGUID, nStrLen Call RpcStringFree(lpStrGUID) sGUID = StrConv(sBuffer, vbUnicode) CreateGUID = UCase$(sGUID) Exit Function End If End If CreateGUID = "Error" End Function William Hindman wrote: >...sorry for previous posting with the wrong subject :( > >Group: > >...the following function using an access wizard library call works in a >full A2K3 install but fails in a >runtime install" > >Private Function ExportRoutine() > Dim db As Database > Dim qdf As QueryDef > Dim lorst As Recordset > Dim strName As String > Dim strFile As String > Const strSpecName = "~~TempSpec~~" > On Error GoTo ExportRoutine_err > With Me.lstResult > strFile = DialogFile(OFN_SAVE, "Save file", "", .Column(3) & " (" & >.Column(2) & ")|" & .Column(2), CurDir, .Column(2)) > End With > If Len(strFile) > 0 Then > 'first get a unique name for the querydef object > strName = Application.Run("acwzmain.wlib_stUniquedocname", "Query1", >acQuery) > Set db = CurrentDb > Set qdf = db.CreateQueryDef(strName, Me.txtSQL) > qdf.Close > With lstResult > Select Case .Column(0) > Case 0 'Transferspreadsheet > DoCmd.TransferSpreadsheet acExport, .Column(1), strName, strFile, >True > Case 1 'Transfertext > DoCmd.TransferText .Column(1), , strName, strFile, True > End Select > End With > End If >ExportRoutine_end: > On Error Resume Next > DoCmd.DeleteObject acQuery, strName > qdf.Close > Set qdf = Nothing > db.QueryDefs.Refresh > Set db = Nothing >Exit Function >ExportRoutine_err: > Resume ExportRoutine_end >End Function > >...I'm certain that its because the function uses the acwzmain.mde library >but I'm not sure I understand why ...if I copythe acwizmain.mde to the >Office11 directory on the runtime installs, the function still fails ...is >there any way to force a runtime to use the library ...or do I have to back >up and approach this in an entirely different way? ...suggestions welcome > > > > > -- Marty Connelly Victoria, B.C. Canada