473,385 Members | 1,267 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,385 software developers and data experts.

Subscript out of range error

Hello, I keep getting subscript out of range error when connection to the database and I can't figure out why, there is already an existing connection with the table. Any help would be highly appreciated, thank you!

Expand|Select|Wrap|Line Numbers
  1.  
  2. With ActiveWorkbook.Connections("mnlsapp02 SLP B10Data") _
  3.         .OLEDBConnection
  4.         .BackgroundQuery = True
  5.         .CommandText = Array( _
  6.         "SELECT * FROM dbo.B10Data WHERE SalesPeriod = '" & Period & "'")
  7.         .CommandType = xlCmdSql
  8.         .Connection = Array( _
  9.         "OLEDB;Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=True;Data Source=mnlsapp02;Use Procedure for Prepare=1;Auto T" _
  10.         , _
  11.         "ranslate=True;Packet Size=4096;Workstation ID=MNLW692;Use Encryption for Data=False;Tag with column collation when possible=Fals" _
  12.         , "e;Initial Catalog=SLP")
  13.         .RefreshOnFileOpen = False
  14.         .SavePassword = False
  15.         .SourceConnectionFile = ""
  16.         .SourceDataFile = ""
  17.         .ServerCredentialsMethod = xlCredentialsMethodIntegrated
  18.         .AlwaysUseConnectionFile = False
  19.         '.ServerFillColor = False
  20.         '.ServerFontStyle = False
  21.         '.ServerNumberFormat = False
  22.         '.ServerTextColor = False
  23.     End With
  24.  
May 20 '14 #1
0 1281

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Lukelrc | last post by:
Hi, I have some VBscript that lists the files in a folder. What i want to do is populate an array with the file names and then use that array to populate a list box. I have got as far as...
2
by: jv | last post by:
I have a form that is used every day to create quotes. However, every 2 weeks or so a user would randomly get an error 9 - subscript out range message. I'm not using any array in this form. Does...
8
by: VB Programmer | last post by:
I'm acutally using VB6, not VB.NET, but I couldn't find the newsgroup for version 6.... I need help for something that should be simple. I keep getting a "subscript out of range" error and...
2
by: Henry J. | last post by:
Has anybody run into this index out range exception when opening and then closing a collectionEditor from within a PropertyGrid? I use PropertyGrid to edit configurations in my application. One...
4
by: Sheldon | last post by:
Hi, I have a written a script that will check to see if the divisor is zero before executing but python will not allow this: if statistic_array > 0.0: statistic_array =...
0
by: dalaeth | last post by:
I have searched Google high and low and haven't found anything that works. Here's my problem, hopefully someone will be able to help! I'm using 1.1 Framework, and ODP.NET 9.5.0.7 on a Windows...
6
by: bloukopkoggelmander | last post by:
Hi all. I use Access 2007. I have linked tables set up to a AS400 server. When I try to split the database, I get the following error : Subscript out of range. I have no idea what this mean. I...
1
by: fperri | last post by:
I have converted a database I finished into an MDE. I'm supposed to be delivering it today. I get a subscript out of range error when the user tries to print a report from the print preview window....
1
banning
by: banning | last post by:
Im a PHP developer and I officially HATE ASP why does my code give me this error? ERROR: "Microsoft VBScript runtime error '800a0009' Subscript out of range ...
1
by: Rodney Roe | last post by:
This is a wierd issue that i'm having. When I run the code without having vba open I get the error 9 message, but when I open vba and run the code it runs just fine. Here is the code Public Sub...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.