CreateSQLCursor allows one to run sql against a database with vbscript. I ran across an example and have used it to do updates and counts. If there is another way to do this, I would appreciate learning how. The program I am using only uses vbscript.
Thanks,
Tim
Tim Rutherford...
Does anyone know how to check the status of a cursor? I can't find help on this anywhere. This is updating a table. When I do a count on the table I only get 96 people and I should get 134. My assumption is there are a bunch of people missing a record altogether so I want to see who they...
Hi,
I want to put a file on a user's desktop, but I can't seem to find how to access that environment element. Seem to recall seeing a post in this group about it, but can't find it. Any help would be appreciated.
Thanks,
Tim
Tim Rutherford
www.Manna-Consulting.com
Well it helps to have a field defined as decimal instead of integer. That was my problem as well. Thanks for the tips guys.
Tim Rutherford
www.Manna-Consulting.com
PH,
I added your code and here is my code and I am getting error,"Operation is not allowed when the object is open" (same error I was getting before)
' Create the RecordSet objects.
Set rst = CreateObject("ADODB.Recordset")
' This Recordset will hold the Distribution information
'...
Currently, I am putting data into an adodb.recordset. I am using a field which needs to be decimal, but everytime I use it, the right side of the decimal is '00'. e.g. 15.35 comes in as 15.00. I have spent hours trying to find an example for this. I know I need to set NumericScale somehow...
Hi,
I have a column which contains totals. I want to use SUMIF and add columns which have the word 'Total' but do not also contain the word 'Revenue'. Simple data layout is as follows;
Col A Col B
Revenue 1 50 Row 1
Revenue 2 175
Total Revenue...
You can also add a function to do it.
Function AddRow(RowArray) 'idxRow s/b set to 1 at start
' of your program
idxCol = 1
For Each idxCell in RowArray
xl.ActiveSheet.Cells(idxRow,idxCol).Activate
xl.ActiveCell = idxCell
idxCol = idxCol...
Tom,
FYI, I found if you don't have the sort statement before you start loading data, it doesn't sort it (I am using a report writer which uses vbscript). You need to have .Sort right after the .Open statement.
Someone correct me if I am wrong.
Tim
Tim Rutherford
www.Manna-Consulting.com
Tom,
I found my problem. There needs to be an equal sign after 'Sort'.
rst.sort = "a, b, c"
I was using rst.sort "a, b, c" w/out the '='
Thanks for the ideas to check anyhow.
Tim
Tim Rutherford
www.Manna-Consulting.com
Tom,
When I comment out the 'Sort' line, the code works. However, as one would expect, not sorted. BTW, what parameters would I use with the Open statement. I am pretty new to adodb and don't recall seeing parameters for Open.
Thanks,
Tim
Tim Rutherford
www.Manna-Consulting.com
Hi,
When I try adding a sort to my adodb, I am getting an error, 'Wrong number of arguments or invalid property assignment'. I have checked all over for examples and can't seem to resolve this. The error occurs with the sort. Will someone point out what I am doing incorrectly?
Thanks,
Tim...
XLBO,
The error I am receiving is, "The cell or chart you are trying to to change is protected...", but this message occurs AFTER the event. I insert the row and protect the sheet again after that. Where can I prevent this message?
Tim
Tim Rutherford
www.Manna-Consulting.com
Hi,
I am inserting a line with the following code, but I still get an error message even though I have .displayalerts = False.
Any ideas or suggestions.
Thanks, Tim
Private Sub WorkSheet_BeforeDoubleClick(ByVal Target As Excel.Range, Cancel As Boolean)
Application.DisplayAlerts = False...
Dalex,
In the vba window double click on ThisWorkbook to open that window. In the General tab choose 'Workbook' and it should default to Sub Workbook_Open(). Add the following to the code "Application.Run "Your Macro" or put the code you created here.
HTH,
Tim
Tim Rutherford...
Hi,
I can hide the VBE when I have a regular module (), but not when I try to add an event. The code works other than that. Any suggestions?
Thanks, Tim
Sub AddModule()
Const vbext_ct_StdModule = 1 'Regular module
Const vbext_ct_ClassModule = 2 'Class Module
Const vbext_ct_Document =...
Hi Tony,
I tried your suggestion. However, it didn't work. When I read your answer, that looked exactly like what I was seeking.
Instead, I am formatting the spreadsheet from the report writer I am using.
Thanks,
Tim
Tim Rutherford
www.Manna-Consulting.com
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.