473,320 Members | 1,694 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How to Set ODBC Timeout Property in ADOX Stored Query

I have the following code in an Excel 2003 module that creates a query
in MS Access 2003. The created query can then be opened from Access.

In Access, right-mouse clicking in design mode, in properties, the
ODBC timeout setting is blank.

How can I set this from Excel's VBA code when "MainProgram" is
executed? (Commandtimeout does not set this property)

'================================================= ============================
Const strProvider As String = "Provider=Microsoft.Jet.OLEDB.4.0;"
Const strDBSource As String = "ServerLocation\AS400 Fields.mdb"

Public Sub MainProgram()
Build_Qry_String
ConnectionStr = strProvider & " Data Source= " & strDBSource
CreateQuery strDBSource, QryStr, "qryTemp"
End Sub
'================================================= ============================
Private Sub CreateQuery(strDBPath As String, _
strSQL As String, _
strQryName As String)
Dim catDB As ADOX.Catalog
Dim cmd As ADODB.Command

Set catDB = New ADOX.Catalog
catDB.ActiveConnection = "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & strDBPath
Set cmd = New ADODB.Command
cmd.CommandText = strSQL
catDB.Views.Append strQryName, cmd

Set catDB = Nothing
End Sub
Nov 13 '05 #1
0 3663

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Andreas Lauffer | last post by:
I changed from Access97 to AccessXP and I have immense performance problems. Details: - Access XP MDB with Jet 4.0 ( no ADP-Project ) - Linked Tables to SQL-Server 2000 over ODBC I used...
1
by: Vincento Harris | last post by:
sql server 2000 8.00.194 Microsoft Windows 2000 Service Pack 2 I looked into my sqlserver agent log and found the following ODBC Error 0 Timeout expired logon to server local '( failed)' ...
8
by: Vladimir | last post by:
Hello, I have a table in MS Access database. It has one field (with BYTE datatype) that has several properties set in Lookup tab of table Design View. Display Control = Combo Box. Row Source...
4
by: Paul | last post by:
I sometimes get a timeout error when populating my datagrid, the code is WizardConnection.Open() UpdateCommand.CommandText = "EXECUTE sp_assign_user '" & PhysOffice.SelectedValue & "', '" &...
11
by: DraguVaso | last post by:
Hi, I want to make a small application in VB.NET that relinks all the query's and tables in an Access database that are linked via ODBC to an SQL Server. It must be able to relink all the tables...
2
by: Tim Frawley | last post by:
I am attempting to change the ODBC Link Provider String in an Access database linked to an Oracle server using ADOX in VB.NET. I created some code using the example from post:...
1
by: ryanb31 | last post by:
When I call databind on my gridview which uses a SqlDataSource as its DataSourceID, after 30 seconds I get the error "Timeout expired. The timeout period elapsed prior to completion of the...
3
by: wjreichard | last post by:
OK ... I am using UPS Worldship that issues an ODBC query to my MS2K server ... Worldship can query either a table or a view and retreive shipping info for a supplied orderid. I need to create a...
2
by: teddysnips | last post by:
One of our clients has reported a problem. Everything was working fine on Monday, but since Tuesday all is going wrong. The sysadmin assures me that there have been no changes to the network, or...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.