Excel ODBC lock mode settings

DerekF

Board Regular
Joined
May 28, 2006
Messages
138
Can you set lock mode settings in Excel. I have multiple ODBC queries that run and they seem to be conflicting with other insert queries from another program. We think it has to do with the database locking settings.

Is there a way I can manually set the lock settings in my ODBC connection in Excel?

Here is my existing code.

Set QT = WSW.QueryTables.Add(Connection:= _
"ODBC;DRIVER={Ingres};SERVER=" & Worksheets("QC").Range("E38").Value & ";DATABASE=" & Worksheets("QC").Range("E39").Value & ";SERVERTYPE=INGRES;UID="";PWD=""" _
, Destination:=Range("A1"))


With QT
.CommandText = Array( _
"SELECT ""WATER_LEVEL@T"".STATION_NO, ""WATER_LEVEL@T"".READING_DATE, ""WATER_LEVEL@T"".READING_VALUE" & Chr(13) & "" & Chr(10) & "FROM INGRES.""WATER_LEVEL@T"" ""WATER_LEVEL@T""" & Chr(13) & "" & Chr(10) & "WHERE (""WATER_LEVEL@T"".STATION_NO='" & Worksheets("QC").Range("E35").Value & "') AND (""WATER_LE" _
, _
"VEL@T"".READING_DATE>date('today')-date('" & Worksheets("QC").Range("E36").Value & " days'))" & Chr(13) & "" & Chr(10) & "ORDER BY ""WATER_LEVEL@T"".READING_DATE")
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = True
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = False
.RefreshStyle = xloverwritedelete
.SavePassword = True
.SaveData = False
.AdjustColumnWidth = False
.RefreshPeriod = 0
.PreserveColumnInfo = True
.Refresh BackgroundQuery:=False


End With
Code:
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

Forum statistics

Threads
1,222,029
Messages
6,163,491
Members
451,838
Latest member
DonSlayer

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top