Clodoaldo Monteiro Posted December 10, 2023 at 08:22 PM Report Share #632377 Posted December 10, 2023 at 08:22 PM Olá! Estou conectando a uma tabela DBF com o drive VFPOLEDB, para excluir determinados registros e até aí tudo bem, mas quando tendo executar o comando PACK, para uma exclusão definitiva, o object connect retorna erro, alegando não ter exclusividade para executar o PACK.Assim faço a conexão: cnConnection := CreateObject( "ADODB.Connection" ) cnConnection:ConnectionString := ; "Provider=VFPOLEDB.1" +; ";Data Source=" + cPath +; ";Exclusive=Yes" +; ";Collating Sequence=general" //=Machine ou =general cnConnection:CursorLocation := AD_USE_CLIENT cnConnection:CommandTimeOut := 600 cnConnection:ConnectionTimeOut := 600 cnConnection:open() Executa as exclusões: mSQL := "Delete FROM Dia" mSQL += " Where dia_tl = 'A' AND dia_mm = '" + pe_mm + "';" oCommand := CreateObject("ADODB.Command") oCommand:ActiveConnection := oCnVfp oCommand:CommandText := mSQL oCommand:Execute() Aqui tento fazer o PACK: mQuery := "PACK" oCommand:CommandText := mQuery oCommand:Execute() Descrição do erro: "File must be opened exclusively" Desde já, agradeço a ajuda. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now