Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
K

KreativeKai

@KreativeKai
About
Posts
221
Topics
69
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • VBApp with a Crystal Report in it. Where do I find it when published.
    K KreativeKai

    Ok, let me try to explain my dilemma. I have a VBApp that I can't republish due to another issue, but the crystal report in the app, that is published on our server needs a very minor tweak. When published, where is the .rpt file put? I'd like to just change the .rpt file with the modification we need without republishing. I found config data in the c:\users\nameofuser\appdata\local\apps\2.0\data directory, but no sign of where the .rpt file gets put. Any idea where VS.Net puts this?

    Lost in the vast sea of .NET

    Visual Basic csharp visual-studio sysadmin help question

  • Scheduled Tasks aren't working
    K KreativeKai

    I started an MSDN call today. We'll see what happens.

    Lost in the vast sea of .NET

    Hosting and Servers csharp help visual-studio sysadmin windows-admin

  • Scheduled Tasks aren't working
    K KreativeKai

    From research it seems like Microsoft rewrote scheduled tasks due to some security issues. It seems like scheduled tasks only handle items that are non-interactive. All my tasks don't have any interaction, but they do tasks with applications like Attachmate Reflections to pull data from our HP3000. I've tried to make a test app as non-interactive with no background screens popping up, or anything, but it still doesn't work. I'm putting debug statements in this program to see if I can find where it is bailing even though Microsoft says it finished successfully.

    Lost in the vast sea of .NET

    Hosting and Servers csharp help visual-studio sysadmin windows-admin

  • Scheduled Tasks aren't working
    K KreativeKai

    I have about 30 VB Apps that are humming along on a Windows 2008 server using scheduled tasks. They all do a variety of simple to complex tasks from pulling data and merging letters on a monthly basis, posting data on our website, converting data to crystal reports, etc. It’s now past the time for us to get off of our Windows 2008 server so I’m taking the apps and converting them up from Visual Studio 2012 to Visual Studio 2019. No real hurdles. Everything is converting fairly clean and running great. Problems begin when I set the apps up on Windows Server 2019. We have a user that is used for processing tasks and has the appropriate rights on the server. If the tasks are setup to run overnight and I leave the server signed on, the tasks process fine. If I sign off of the server the tasks show that they ran and that they completed successfully, but never finish processing. The status shows they completed at the same time the schedule is triggered, and most of the tasks normally should run 15 minutes to an hour. Nothing in the event log to say it failed, and I have a good bit of error code built into each program that would fire an error if one was triggered. The task is setup to “Run whether user is logged on or not”, and also “Run with highest privileges”. Did something change since 2008 regarding scheduled tasks that I should be aware of? Any suggestions / help with this is appreciated. I’ve Googled it, but haven’t had much luck.

    Lost in the vast sea of .NET

    Hosting and Servers csharp help visual-studio sysadmin windows-admin

  • Bald Eagle - Live feed
    K KreativeKai

    Hi all, In our community about three miles from our house there is a state park. This spring they have a real interesting link showing two bald eagles and their nest that currently has two eggs in it. The link has gotten fairly popular and I even saw it on weather.com this morning. It is however local to me and my family: http://www.portal.state.pa.us/portal/server.pt?open=514&objID=1592549&mode=2[^] Hope everyone enjoys!

    Lost in the vast sea of .NET

    The Lounge csharp java com sysadmin question

  • how can i delete a listview item fetched from a database???
    K KreativeKai

    This might help: http://stackoverflow.com/questions/19441239/how-listview-delete-data-in-database[^]

    Lost in the vast sea of .NET

    Visual Basic database question

  • How to find out if a file is in use before reading the data in that file
    K KreativeKai

    I agree with everything you said in your reply because each situation you're trying to code for can vary. In the situation I have however I won't need to worry about the file being re-locked. Basically the financial system writes a report file in text format and the code I posted in the original thread works to check if the file is currently open. Once the financial system has completed the output it will never be opened again except by my application that is picking it up and converting the report to PDF and then deleting the original text file. My application is executed by a service I wrote that checks if a text file shows up in a certain directory. The service checks every minute. If it sees a text file it executes. My app then goes through the directory and starts reading files for conversion. I don't want to start this process if the financial system has not completed the output, so I'll basically skip if opened and catch it the next time the app executes (1 minute later). My biggest mistake was assuming notepad would hold the file open for testing....

    Lost in the vast sea of .NET

    Visual Basic csharp help tutorial question

  • How to find out if a file is in use before reading the data in that file
    K KreativeKai

    I just did testing with the financial system and the code worked without having to go to the file handles. Thanks again for your reply!

    Lost in the vast sea of .NET

    Visual Basic csharp help tutorial question

  • How to find out if a file is in use before reading the data in that file
    K KreativeKai

    I goofed... I was using notepad over and over to try and replicate the file being accessed. I found that notepad doesn't cause the file to show as open. When I tried Excel, right before doing my post, I goofed and opened my output file instead of my input file. I still need to do some testing when the financial system is writing a file to make sure it works the same way or if I need to take your suggestion and look at the file handle. Thanks!

    Lost in the vast sea of .NET

    Visual Basic csharp help tutorial question

  • How to find out if a file is in use before reading the data in that file
    K KreativeKai

    Hi all, Please ignore my post. I was using notepad over and over to try and replicate the file being accessed. I found that notepad doesn't cause the file to show as open. When I tried Excel, right before doing my post, I goofed and opened my output file instead of my input file. Code works... Thanks to anyone that started researching this issue...

    Lost in the vast sea of .NET

    Visual Basic csharp help tutorial question

  • How to find out if a file is in use before reading the data in that file
    K KreativeKai

    Hi all, We have a financial system that writes a text file out that could be several 100 or even 1000 lines long. It writes the file into a txt file and can't be modified to be another file extension and then be renamed after the data has been loaded. I have a service already written that notices that a txt file has shown up in this directory and fires off the application that needs to read this data. I don't want to have the application which reads the data begin the process until after the financial system has written all data to the file. I've searched all kinds of VB help sites and here is the code most refer to in various ways: Public Function IsFileLocked(filename As String) As Boolean Dim Locked As Boolean = False Try Dim fs As FileStream = File.Open(filename, FileMode.OpenOrCreate, FileAccess.ReadWrite, FileShare.None) fs.Close() Catch ex As IOException Locked = True End Try Return Locked End Function I have my file open in Notepad to test and have the file being accessed, but it falls straight through the code and does not hit the catch. I even opened the file in Excel and had the same result. Any ideas? :confused:

    Lost in the vast sea of .NET

    Visual Basic csharp help tutorial question

  • Starting program with a command line parameter
    K KreativeKai

    I enjoyed the "old DOS days" and still have several DOS manuals on my bookshelf that come in handy once in a while. My problem is that my job responsibilities are 90% COBOL code and mainframe programming and only 10% of the time I can code in Visual Studio. When I do get a chance to work in VB, it sometimes becomes more trial and error. Thanks for your help and enjoy your weekend! :)

    Lost in the vast sea of .NET

    Visual Basic csharp testing beta-testing question workspace

  • Starting program with a command line parameter
    K KreativeKai

    Thanks for the BTW about the VB6 code... I found it on google and didn't realize. I agree, my requirements have outgrown the capabilities of ClickOnce... You asked: Why are you even concerned about the path ClickOnce uses at all?? Basically what I found was if I pass the /CR parm into the app using: 1) The long random ClickOnce path - It works 2) The shortcut ...appref-ms /CR - It doesn't work 3) Published path setup.exe /CR - It doesn't work, and you explained this earlier, which makes sense why it does not... 4) Published path appname.application /CR - It doesn't work, and is probably for the same reason that setup.exe doesn't work. All four ways start the program, but only #1 recognizes the parm? This is where my confusion is. I'm just confused as to if I get the command line code working, which way can I execute the application.... or maybe command line parameters are best used when the application is not click once, which is sort of what you mentioned in an earlier thread. Thanks for all your help so far, and hopefully this will clarify my confusion. :)

    Lost in the vast sea of .NET

    Visual Basic csharp testing beta-testing question workspace

  • Starting program with a command line parameter
    K KreativeKai

    We are using clickonce deployment and yes, I agree this limits control. Setup.exe is not passing the parms, and like you said it basically shouldn't. The only exe that I have found to read the parms passed is when I use the random address they create on the fly. Frustrating... The clickonce deployment gives you so many advantages but in turn takes the flexibility out of the process. Oh well, I've already started coding the first app to call the second app, and I'll have to write and read a file to pass the information between the two and also keep the clickonce setup intact. Thanks as always for your input...

    Lost in the vast sea of .NET

    Visual Basic csharp testing beta-testing question workspace

  • Starting program with a command line parameter
    K KreativeKai

    I've googled, searched CodeProject, etc, and I hope I'm overlooking something, but here is what I want to do: I want to call a Windows Form application from another Windows Form application. The program being called, may be called from different form based applications and needs to know who is calling. I've found in testing, that with this code, I can accept a parameter: Public Shared Sub Main() If Command$() = "/CR" Then strAppStartedFrom = "CR" 'Started from Check Recon Application Else strAppStartedFrom = "--" End If MsgBox(strAppStartedFrom & Command$()) frmFTP.ShowDialog() End Sub I've published it, and from what I can find it puts the exe in this location? C:\Users\username\AppData\Local\Apps\2.0\0BTCBQ53.QL1\OMCV071R.O93\carr..tion_c302ad764aefaa28_0001.0001_bcaadc20b696e727\CarrollFlexFTP.exe /CR This path seems like it might change and not be consistent when installing it for different users. The above link works if it is executed with a /CR parameter, but I need a more stable way of doing this. In the past I've pointed shortcuts to the setup.exe file in the location we publish the application to, but if I run the app using the setup.exe /CR parameter, it doesn't work. Suggestions?

    Lost in the vast sea of .NET

    Visual Basic csharp testing beta-testing question workspace

  • Setup DSN programmatically on the fly
    K KreativeKai

    Thanks Dave! This worked very well in Windows 7 without breaking the app for my XP clients. I was looking at your profile. Congratulations on all the MVP awards over the years! I don't post much on Codeproject, just a couple questions and a few answers a year, but I believe you've probably answered most of my posts. I see you hit 9 years as of today, March 12th, Congratulations... Thanks again for your help! :)

    Lost in the vast sea of .NET

    Visual Basic help database visual-studio sysadmin question

  • Setup DSN programmatically on the fly
    K KreativeKai

    The DSN is being setup for the Crystal reports that are initiated by the application.

    Lost in the vast sea of .NET

    Visual Basic help database visual-studio sysadmin question

  • Setup DSN programmatically on the fly
    K KreativeKai

    Hi all, Hope someone can help with this... I wrote this code several years ago and it has worked great in XP. Our department is rolling out Windows 7 and the agency that uses the app I wrote are finally receiving their new Windows 7 systems. One problem... code doesn't work any longer. The code sets up a DSN entry on the fly. In XP, a standard user without any elevated rights could run the app and this code worked. Now in Windows 7 when installing, I have the end user setup as local administrator and the app fails to Create the DSN. If I go in and right click on the "Click-Once" setup.exe and select "Run as administrator" it works. Also if I create a shortcut to the setup.exe and change the advanced settings to "Run as administrator" it also works from that shortcut. If I use the icon created by the program from the "Start" menu or from the desktop, which doesn't have an option to "Run as administrator", even though the client is setup as local administrator, it kicks an error that it can't create the DSN. I can delete the DSN and see when it is created and when it can't and it coincides with the trials I've listed above. Is there something I can put in code that allows it to work no matter if administrator or if a standard user, like it did in XP? Some google posts talk about UAC causing the problem, but just say they recommend to run as administrator. I've searched google and code project, and most articles / posts seem to be from 2004 or around that time. We're using VS 2010... Is there a better way to creat the DSN's on the fly with VS 2010? :confused: Here is the code Public Declare Auto Function SQLConfigDataSource Lib "ODBCCP32.DLL" _ (ByVal hwndParent As Integer, ByVal fRequest As Integer, ByVal lpszDriver As String, ByVal lpszAttributes As String) As Integer Private Const ODBC_ADD_SYS_DSN As Integer = 4 Friend Shared Sub Create_DSN_For_Crystal_Reports() Try Dim attributes As New System.Text.StringBuilder() Dim returnCode As Integer attributes.Append("DSN=CCPROD") attributes.Append(Chr(0)) attributes.Append("Server=CCPROD") attributes.Append(Chr(0)) attributes.Append("Description=DSN added via code from Beneficiary System") attributes.Append(Chr(0)) attributes.Append("Database=HrPr") attributes.Append(Chr(0)) attributes.Append("AnsiNPW=Yes") attributes.Append(Chr(0)) attributes.Append("QuotedId=Yes") attributes.Append(Chr(0)) attributes.Append("Trusted_Connection=Yes") att

    Visual Basic help database visual-studio sysadmin question

  • VB 2010 code fails when copying root directory.
    K KreativeKai

    Thanks for the clarification! It is evident now that I was misunderstanding the File.Attributes logic. :)

    Lost in the vast sea of .NET

    Visual Basic visual-studio csharp sysadmin debugging tools

  • VB 2010 code fails when copying root directory.
    K KreativeKai

    Thanks for all your help Luc! It is appreciated! :cool: Below is the code I used in case anyone else can learn from it later when searching the message boards... Dim di As DirectoryInfo For Each di In currentDirectory.GetDirectories() Dim strDirectoryName As String = di.Name Dim intFoundRB As Integer = strDirectoryName.IndexOf("$RECYCLE.BIN") Dim intFoundSV As Integer = strDirectoryName.IndexOf("System Volume Information") 'Skip $Recycle.Bin or System Volume Information directories If (intFoundRB = -1) And (intFoundSV = -1) Then Try ... Copy logic Catch ex As Exception ... logic writing to log file for future reference if needed... End Try End If Next

    Lost in the vast sea of .NET

    Visual Basic visual-studio csharp sysadmin debugging tools
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups