SSIS Expressions Problem

Hi All,
Please help on the SSIS issue.
i have a package.It contains Foreach loop container,Inside foreach loop container,I have one Dataflow task(Inside dataflow task,i am using Oledb source(table),I am populating 
Data into Flat file)with flat file name YYYYMMDD_HH24MISS.txt. After i want to Zip that file with same file name. 
YYYYMMDD_HH24MISS.txt.zip,After that i want copy that Zip file into another location.
Thanks in advance...

Hi BADDULAS,
According to the screenshot in your initial post, you are using an Execute Process Task to compress the .txt file generated by the Data Flow Task. Let’s assume that you are using the common free software 7-Zip as the executable of the Execute Process Task,
then you can refer to the following blog:
http://sqlage.blogspot.com/2013/12/ssis-how-to-compress-and-archive-file.html 
To get the expected name for the txt file, you can create another String type SSIS variable @[User::FileName] using the following expression (set EvaluateAsExpression property of the variable to True):
REPLACE(SUBSTRING((DT_STR,30,1252)GETDATE(),1,10),"-","")+"_"+ SUBSTRING((DT_STR,30,1252)GETDATE(),12,2) + "24MISS.txt"
The FileName variable should be used by the ConnectionString property of the Flat File Connection Manager that is used by the Flat File Destination in the Data Flow Task.
Besides, the variable FileName should also be used in the expression of the VarSourcePath variable and the VarArchivePath variable as follows:
VarSourcePath:  “C:\\Temp\\Source\\” + @[User::FileName]
VarArchivePath: “C:\\Temp\\Destination\\” + REPLACE(@[User::FileName], ”.txt”, “”)
Regards,
Mike Yin
TechNet Community Support

Similar Messages

  • HT1515 Just installed Airport Express on Mac 10.6.8  Can't see base station.  Hard Reset the Airport.  Rebooted machine.  How can I tell if this is a Mac problem or Airport Express Problem?

    I have a Mac 10.6.8.  Just installed Airport Express.  I can't see any base stations.  I did a hard reset on the Airport Express, turned off all devices,  turned them back on.   I see plenty of Airport networks in the neighborhood.  How can I tell if I have a Mac problem or an Airport Express problem?  Airport Express blinks Amber. 

    Obviously,  I'm still using ethernet to be able to reply to this.
    Alright, use the same ethernet cable to plug directly into the airport express. This will FORCE the airport utility to now see it regardless of weak signals & interference. You can set it up that way.
    BTW, what is the original intent on the express?

  • SSIS Expression to Server Name from a Connection String

    Hi,
    I have an SSIS variable which contains a connection string as follows; -
    User::strD​YNconnecti​on {Data Source=myServer;Init​ial Catalog=myDatabase;Provider​=SQLNCLI10​.1;Integra​ted Security=XXXX} String
    I need to get the server name from the above variable using an SSIS expression so I can pass the server name to another function.
    Thanks in advance,
    Kieran.
    Kieran Patrick Wood http://www.innovativebusinessintelligence.com http://uk.linkedin.com/in/kieranpatrickwood http://kieranwood.wordpress.com/

    Hi Kieran,
    This works fine when the Data source comes first in the connection string (which it usualy does). but when it doesn't,
    e.g.
    Init​ial Catalog=myDatabase;Data Source=myServer;Provider​=SQLNCLI10​.1;Integra​ted Security=XXXX}
    you will get 'myDatabase' as an answer
    I would add 'Data source =' in the find string (and adjust for length of this search string to add sufficient offset)
    e.g.
    SUBSTRING(RIGHT(@[User::strDYNconnection],LEN(@[User::strDYNconnection]) - 11 - FINDSTRING(@[User::strDYNconnection],"Data Source=",1)),1,FINDSTRING((RIGHT(@[User::strDYNconnection],LEN(@[User::strDYNconnection]) - 11 - FINDSTRING(@[User::strDYNconnection],"Data
    Source=",1))),";",1) - 1)
    Even this is not foolproof, when the Data source is the last element in the string and there is no ending ;
    e.g.
    Init​ial Catalog=myDatabase;Provider​=SQLNCLI10​.1;Integra​ted Security=XXXX;Data Source=myServer}
    the formula needs to be extended further with a ( ? : ) operator around the last operator to see if the last ";" was found or not.
    Jan D'Hondt - SQL server BI development

  • Urgent : - Unusal Express Problem

    Hello All,
    I am getting this unusual express problem when ever I try to
    force complete generation of either an application model or a
    business model in Forte Express!!!
    The error is as follows!!!!
    SYSTEM ERROR: Cannot find project svc.tpl in workspace.
    Class: csExptnFind
    Last TOOL statement: method CompileSession.SetScope
    Error Time: Fri Apr 16 16:02:08
    Exception occurred (locally) on partition "Express_cl9_Client",
    (partitionId = 7D6A7FB0-77FD-11D2-8DE4-2E2B86F5AA77:0x11d7:0x2,
    taskId =
    [7D6A7FB0-77FD-11D2-8DE4-2E2B86F5AA77:0x11d7:0x2.23]) in
    application
    "FTLaunch_cl0", pid 206 on node MISSOURI in environment loo.
    I have verified that the templates are there in the directory
    $Forte\userapp\express\cl9\templates
    Can anyone please help me?
    Thanks in advance
    Mohan
    Get Your Private, Free Email at http://www.hotmail.com
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

    Sessions require session cookies.
    If the user has cookies off then the session won't be retained by the server automatically.
    The solution to this is to use URL rewriting.
    There is a method: HTTPResponse.encodeURL( String url )
    It automatically adds the JSESSIONID used to track the session onto the url if the browser is not accepting cookies.
    You need to do this on every link in the website so that session is maintained.
    Cheers,
    evnafets

  • Another Airport Express problem thread.

    Hi Everyone,
    I got a Powerbook recently and like many on these threads I am beset with Airport Express problems.
    Here's my story. I purchased my Powerbook about a month ago and popped into the Apple Store to ask about the best way to have wireless internet access at home. They recommended the D-Link DSL-300T ADSL modem and Airport Express. I purchased these items and set everything up at home. This didn't work. After a week of talking to Apple, I got the answer to my problem from a Mac message board. Supposedly the ADSL modem recommended by Apple and stocked in their online store wasn't compatible with the lastest version of Airport Express 6.2.0. So I dowgraded the firmware to 6.1.1 and everything worked fine. My next problem was after running an OS X software update which I can presume also updated the Airport Express back to 6.2.0. So again I downgrade to 6.1.1 and it works again. Then I have to get my Powerbook replaced as the refurb Apple sold me didn't have the superdrive in it that Apple advertised, so I transfer my settings and files and i can go online for a couple of days and then it stops working again. I do the downgrade again but this doesn't help. So I take it to see a genius at Apple who performs the AE update 2005-001 which he says will solve the problem of incompatability with 3rd party modems. Take it home, it doesn't work. Powerbook almost gets thrown out of the window.
    Why is something that should be so simple so difficult.
    My questions are does anyone have a D-Link DSL 300T modem that works with the update 2005-001 ???
    Why do Apple recommend an ADSL modem which doesn't work with their products ???
    What ADSL modem for the UK does work with Airport Express ???

    Hi Bollard, not sure whether this would work with the current model of the modem, but I ran into problems with the DSL300+ when first using it wit an airport extreme, back in 2003.
    I eventually resolved the problems by using the modem in bridging mode. Not sure if this would be applicable with the new model, or whether it work if you are needing PPPoA rather than PPPoE, but for what its worth my experiences and solution can be found at http://discussions.apple.com/thread.jspa?messageID=607296&#607296 I've had a fair bit of positive feedback from people who found it worked for them, at least with similar equipment and connection protocol.
    Cheers
    Rod

  • SQL Express problem client connection

    SQl Express problem, I can't connect another computer.
    I have sql express on win xp, and one client win 7 starter. The firewall is disable, I can ping the server computer (win xp pro). On Sql Configuration Manager I enable TCP/IP protocol and named pipes. ODBC local is fine, but remote don't connect.
    If anyone has an idea about this
    Felipe Script Center

    You hae to enable remote Connections as well, in Express Edition it's disabled by default, see
    Configure the remote access Server Configuration Option
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • Simple question - compare Strings with SSIS expression language

    SSIS variables - strOne = YES, strTwo = YES. I want to compare strings using ssis expression language (ie inside a variable's expression box, constraint of task flow arrow etc).
    Will @strOne == @strTwo be true ? I hope its not like programming languages where you need to do
    @strOne.Equals(@strTwo) instead of ==. Also is @strOne == "YES" true ?

    ([User::strOne] == [User::Strtwo] ? True : False)
    The third variable created should be of type boolean if you're using above expression. if its of type int return 0 and 1 instead of False and true
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Labview 7.0 express problem with windows xp professional

    we get the usable error window in windows xp professional with some error & asking to send error report or don't send when using labview 7.0 express, whatever option we select the application shutdown.
    please advice its urgent. i am attaching the error log file. is this the application issue or the OS problem....?
    Attachments:
    appcompat.txt ‏35 KB

    Xp seems to always ask the user about sending an error report with any application that crashes. THis is an operating system "bonus feature". Let focus on what steps you are doing to reproduce this error. Can you post the vi that is creating the error?
    BJD1613
    Lead Test Tools Development Engineer
    Philips Respironics
    Certified LV Architect / Instructor

  • Can't figure out my Airport Express problem...

    I can't connect to the internet with my Airport Express. I've tried every option but none seem to work.
    I have a RCA Digital Broadband box, which has a ethernet cable that I plug into my Airport. This is a sublease apartment so the internet was already set up and I just want to make it wireless.
    When I go through the setup I choose "I don't have a wireless network and I want to create one" and then I am confronted with the "Bridge Mode" or "Single IP address using DHCP and NAT." I've tried both to no avail. When I choose "Single IP address using DHCP and NAT" it actually tells me that the light will blink amber and asks me to ignore, skip or cancel. The "Bridge Mode" goes straight to the screen I am confronted with if I skip the amber light warning.
    It asks for: Configure IPv4, IP address, Subnet Mask, Router Address, DNS Server, Domain Name and DHCP Client ID. I leave it all as is so only IP and Subnet have information filled in.
    Anyways, this fails as usual. I get the error saying that the "Apple wireless device does not have a valid IP address." I can pull the ethernet from the Airport and plug it into my laptop and I am connected in seconds... it's very annoying. Any idea of what I am doing wrong?
    Sometimes, actually, I get the light to turn green and it says I am connected but the internet still doesn't work. Figures.

    Hi,
    Well, I went through the entire process (selecting bridge) and ignored the last problem where it said that Airport didn't have a valid IP. The light on my Airport is green and my Airport icon on my mac gives me full bars; however, there is still no internet.
    I went into the internet options as you suggested and here are the results:
    Connect using: Ethernet
    Configure IPv4: Using DHCP
    IP Address: 169.254.18.108
    Subnet Mask: 255.255.0.0
    Routher: (blank)
    DNS Server(s): (blank)
    Domain name: (blank)
    DHCP Client ID: (blank)
    Ethernet WAN Port: Automatic (Default)
    Connection Sharing: Off (Bridge Mode)
    When I press the airport tab and click status, which says normal and is green, it brings me to a new section. This section says there is an issue with my internet connection and the cause is that my "Apple wireless device does not have a valid IP address."
    That seems to be the issue. I don't know how to fix it though. One thing that looks out of place is that when Airport Utility is searching for my Airport Express network, it reports that the IP address is fe80::21f:f3ff:fef9:fe54%en1.

  • 10.5.7 aiport express problems resolved - so far :)

    Hello all,
    Since updating my OS to 10.5.7 I have been experiencing frequents drop-outs when trying to stream music through Airtunes from my computers (duocore2 MacBook and 1st gen. intel iMac) to my Airport Express (G). I have past the last 2 days reading threads on Apple discussion board, Mac fixit, Googling, hard-resetting both my Airport extreme (N - gigabit) and Airport Express (G), pram-zapping both my computers, repairing permissions, deleting plist files, cursing all the saints names I know of (my catholic heritage ) to finally have both my computers being able to stream music normally to my Airport Express, without drop-outs. Here's what I've done, I thought I share it with you since this seem to be a common problem:
    Hard-reset both my Airport (by pressing with a pen the little button intended to do so).
    Important: DON'T upgrade the firmware of your airport extreme to 7.4.1, leave it to 7.3.2 (or downgrade to 7.3.2 if you already upgraded), since 7.4.1 is a not ready for prime time firmware update, it messes everything, I repeat, stay away from 7.4.1
    1. Unplug the Airport Express, make sure the Airport extreme (or whatever base station you use) is on and attached to your modem (cable, dsl...). Open Airport utility and set the base station manually (Airport extreme n - attached to my cable-modem, in my case) as follow:
    1st tab (Airport)
    - Base station menu:
    Give the airport the name you want (airportbase, in my case)
    Fill the password fields
    Check "Remember this password in my keychain"
    Leave checked "Set-time automatically" (not important, default I guess)
    Leave unchecked "Allow set-up over WAN"
    - Wireless menu:
    "Wireless Mode" = Create a wireless network
    "Wireless network name" = the same name as the base station (airportbase, here)
    "Allow this network to be extended" = unchecked
    "Radio mode" = 802.11n (802.11b/g compatible)
    "Channel" = 10 (VERY IMPORTANT, THAT DID THE TRICK, my express started to work normally only after I assigned a specified channel to my base station)
    "Wireless security" = WPA2 Personnal
    Fill the passwords field
    Check "Remember this password in my keychain"
    In this menu, there's a button at the bottom named "Wireless options", when clicked a new window appears in which I have the following settings:
    - Country: Canada
    - Multicast rate: 2 mbps
    - Transmit power: 100%
    - WPA group key time out: 364 DAYS
    - Create a close network = unchecked
    - Use interference robustness = unchecked
    - Acces menu:
    Mac address acces control = Not enabled
    2nd tab (Internet)
    - Internet connection menu:
    Connect using = Ethernet
    Configure IpV4 = Using DHCP
    Ethernet Wan port = Automatic (Default)
    Connection Sharing = Share a public IP address
    - DHCP Menu:
    DHCP beginning address = (from drop down list) 10.0 and then (next case) .1 and then .2
    DHCP ending address = 10.0.1.200
    DHCP lease = 364 DAYS
    - NAT Menu:
    enable default host as = unchecked (and next field is empty)
    enable NAT port mapping protocol = checked
    3rd tab (Printers)
    unchanged (the "Share printers over WAN" option is Unchecked)
    4th tab (Disks)
    - I can see my attached external drive name in the Disks menu
    - In the File sharing menu, "Enable file sharing" is checked, "with Airport extreme password" is selected in the "Secure shared disks" drop-down list, "Remember this password in my keychain" is checked, "Not allowed" is selected in the "Airport disks guest access" drop-down list and "Share disk over WAN" is unchecked.
    5h tab (Advanced)
    - Statistics menu: The "Syslog destination Address" field is empty, "Syslog Level" is set to "5 - Notice" from the drop-down list (default?), "Allow SNMP" is checked and "Allow SNMP over WAN" is unchecked
    - Port mapping menu: Empty
    - IPv6 menu: "IPv6 Mode" drop-down list is set to "Link-local only"
    Click Update and wait for the Airport extreme base station to restart.
    After the airport extreme is up and running (green light), restart all the computers that will be using your network.
    Open System Preferences on all the freshly rebooted computer, click on the "Network" icon, select and add your newly created network and click "Apply". Then click the "Advanced" button and go to the TCPIP tab and make sure "Configure IPv6" is set to "OFF" and then click "Apply".
    2. Plug in the Airport Express and open Aiport Utility and set the Airport express manually as follow:
    1st tab (Airport)
    - Base station menu: give the airport express the name you want, fill the password fields and check "Remember this password in my keychain"
    - Wireless menu: Select "Join a wireless network" form the "Wireless Mode" drop-down list. Enter your airport base station name in the "Wireless Network Name" field (or select it from the drop-down list, it should be there, by default, anyway). Select the security (if not already selected after you select your network name - WPA/WPA2 Personnal, in my case), fill the password fields.
    2nd tab (Internet)
    Select "Using DHCP" from the "Configure IPv4" drop-down list
    3rd tab (Music)
    Check "Enable Airtunes.
    In the "iTunes Speaker Name" field, put the same name as the one you gave to your airport express. Don't fill the password fields.
    4th tab (Printers)
    Unchanged (nothing there sinc no printer is attached to my express)
    5th tab (Advanced)
    The "Syslog destination Address" field is empty, "Syslog Level" is set to "5 - Notice" from the drop-down list (default?), and "Allow SNMP" is checked
    Click the Update button and wait for the Airport express to restart.
    After the airport express is restarted (green light), restart your computers, repair permission on all of them and then restart your computers again.
    Now, you should be able to stream music to your airport express.
    3. Finally, next time Apple issues a system update, wait a good month before updating, then go on Apple discussions boards and search for the number of the update, like 10.5.7 in this this case, along with airtunes problems, like 10.5.7 airtunes problems, that's what I will do. Chill!

    Thanks for a very complete and thorough description wiiphone!
    Question about your wireless channel: Are there any other competing wireless networks in your area that led you to choose channel 10?
    If you don't mind doing some experimenting, does changing the channel from 10 to some other (fixed) channel, have any effect? The reason for asking is that I have reason to believe "automatic" might not be desirable, but there ought not to be anything magical about channel 10.
    Please post if you experience any more dropouts. I'm glad it's working for you; I'm just doubtful this will prove to be a permanent fix.

  • AirPort Express problem on MacBook Pro

    I'm having problems connecting to the internet via work place LAN while booted up in Lion.  Sometimes I can go into settings preferences or what ever that's called and get it to work by trial and error but it's very difficult.  Right now I'm using AirPort Express connected to the LAN but I get the same problem when connecting directly to the LAN.  And again I can sometimes get conection by trial and error but with great difficulty.  What's strange though is that when I boot up into Windows 7 bootcamp I get a connection emediately with no problems.

    I had the same problem. The Airport Express (used to provide ethernet access to a G5) would join my b/g 2.4Ghz network (from Dual Band Airport Extreme) instead of the 5Ghz "n" network (from same Airport Extreme)
    Oddly, when I changed my Dual Band Airport Extreme from "802.11n only (5GHz) - 802.11b/g" to "802.11n only (5GHz) - 802.11b/g/n" my Airport Express would join the 5Ghz network fine.
    This seems to be somewhat finicky, but i've got it working the way I want at the moment with the current settings:
    Airport Extreme:
    Create Wireless Network
    802.11n only (5GHz) - 802.11b/g/n
    Channel (Manual) 161, 1
    Use Wide Channels
    Airport Express:
    Join Wireless Network

  • Airport Express problems with new MAC MINI and DLINK router SOLVED

    Hi just thought I would post this as it may well help others experiencing similar frustrations with new core duo mac mini and wireless connection or quality problems across the network / internet etc
    I have a 3 week old, new mac mini core duo 1.8ghz 2gig ram, 120gb disk - First Mac, connecting to my exisiting wireless network via DLINK ADSL Router 2MB Broadband also one windows laptop and pc also wireless on the network and two airport express potins to stream itunes to
    Problem was briefly
    Mac worked fine, but the network connection just far too slow, laptop and pc, 1800+ kbps downstream mac mini 90 - 150kbps (http://www.adslguide.org/tools/speedtest.asp)
    also if i ping the router directly from terminal (ping -c 20 192.168.1.1) average response 12+ ms with 20% packet loss, yet laptop and pc avg 2ms no losses
    Spent 2 evenings on frustrating calls of more than 1 hour each (due to being cut off , then ring back and closed etc etc) and carrying out a the helpdesk troubleshooting (I am an IT consultant I think I am above this level), eventually an archive and install of the os as well
    last night I call for the third time, insisting I dont wish to carry out any further troubleshooting, and want it replaced and resolved or my money back
    I receive a call back from product specialist (not sure if thats mac mini specialist or airport) but we resolved the issue (his knowledge far superior to the help desk do this do this attitude)
    between us we carried out the folowing and resolved the problem and I am now very happy
    mac now downstreaming also in excess of 1800kbps (as expected for 2mb broadband)and no packet loss
    This problem was resolved by switching off the turbo option hidden away in the routers settings, under wireless configuration
    Supposed to improve performance, but its rubbish and will make hardly any difference under mac os to the speed but will certainly affect your mac mini performance(you may have a similar setting switched on in your routers and mac os dont like it)
    We stumbled across this by first disconnecting one of the airport express devices from my dlink network, and using it on its own default apple wireless settings, effectively making it a standalone wireless network, and not via the dlink router
    we then carried out the same ping with the ip address of this device (from airport admin utility default 10.0.1.1) and the results were fantastic 2ms avg no package loss
    this established it was something with the router, and how we then interrogated the routers settings and found the turbo on option within wireless configuration
    you may not be able to replicate this if you dont have an additional network you could join (such as airport express), but probably worth checking your own router settings for something similar
    Hope that may be of assistance to others, sorry that its a bit long winded and garbled, but I'm just so excited to finally get my new mac working as i would expect it to
    Also perhaps insist on speaking to a product specialist immediately that the helpdesk are unable to help you

    Hello macfar14. Welcome to the Apple Discussions!
    For just streaming iTunes and/or for sharing a USB printer, the AirPort Express Base Station (AX) just needs to be configured as a wireless client ... which you already attempted to do.
    Just to be sure nothing was missed, here are the basic steps to do this:
    Either connect to the AX's wireless network or connect directly, using an Ethernet cable, to the Ethernet port of the AX, and then using the AirPort Utility in "Manual Setup" mode, make the following changes:
    AirPort > Wireless
    o Wireless Mode: Join a wireless network
    o Network Name: <existing wireless network's Network Name or SSID>
    o Wireless Security: <select the encryption type of the existing wireless network>
    o Wireless Password: <enter the existing wireless network password>
    o Verify Password: <re-enter the existing wireless network password>
    Music
    o Enable AirTunes (checked)
    o iTunes Speaker Name: <enter desired speaker name>
    o iTunes Speaker Password: (optional)
    o Verify Password: (optional)
    o Click Update to write the new settings to the AX
    In iTunes:
    iTunes > Preferences... > Advanced > General
    o Look for remote speakers connected with AirTunes (checked)

  • Uninstall/install oracleXE express problems on windows vista business

    Hi,
    I installed oracle express on windows vista.. no problem. Then I installed oracle application server... now oracle db web interface was not working (firewall was off). So I tried to uninstall/re-install oracle express.... but now it does not successfully install... in fact the installer just hangs when it is trying to initialise the services.. also it looks like the services were not uninstalled?? any ideas/help would be great I have tried uninstall/reinstall several times all with no success....

    there are several similar threads on XE forum - http://forums.oracle.com/forums/search.jspa?threadID=&q=uninstall+problems+windows+vista&objID=f251&dateRange=all&userID=&numResults=15&rankBy=10001
    also these resources maybe handy;
    * installation guides - http://download.oracle.com/docs/cd/B25329_01/doc/install.102/b25144/toc.htm
    * OTN forum needs extra registration(free) - http://www.oracle.com/technology/xe/registration
    * all documentation - http://www.oracle.com/pls/xe102/homepage?remark=tahiti
    * OTN portal - http://otn.oracle.com/xe

  • Illegal start of expression problem

    In my app I' creating an action listener to check for the click of a button, but this is my first try with an action listener and i'm having a few issues. I'll give you the part of the program that goes before where I get the error.
    import javax.swing.SpringLayout;
    import javax.swing.JButton;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JTextField;
    import java.awt.Container;
    import java.awt.Toolkit;
    import java.awt.Dimension;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    public class BattleSystem implements ActionListener {
        private static void createAndShowGUI() {
             int number = 10;
             int secondNumber = 5;
            //Make sure we have nice window decorations.
            JFrame.setDefaultLookAndFeelDecorated(true);
            //Create and set up the window.
            JFrame frame = new JFrame("System");
            Toolkit theKit = frame.getToolkit();
            Dimension wndSize = theKit.getScreenSize();
            frame.setBounds(wndSize.width/4, wndSize.height/4,
                                wndSize.width/4, wndSize.width/4);
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            //Set up the content pane.
            Container contentPane = frame.getContentPane();
            SpringLayout layout = new SpringLayout();
            contentPane.setLayout(layout);
            //Buttons
            JButton attack = new JButton("Clcik here!");
            attack.addActionListener(this);
            //Health Labels
            JLabel label = new JLabel("Number 1:  " + number);
            JLabel eLabel = new JLabel("Number 2:  " + secondNumber);
            //Handle Button Events
            public void actionPerformed(ActionEvent e) {
                 number--;
                 secondNumber--;
            }It gives me the error illegal start of expression at this line:
    public void actionPerformed(ActionEvent e) {
    How can I get this to work?
    On a differnt question how can I stop the user being able to resize the application window?
    Finally, can you depot Java Applications (not Applets) or do they ahve to be an applet to use them outside the compiler?

    where i come from we say
    "this just ain't right"
    but i understand that you are new to java.
    if you don't understand the modifications then you will have some
    problems. you need to go through the problems one by one.
    the modifications fix compiler errors but that doesn't mean it will work.
    I think you have had bad advice in the past. after you think about it,
    then if you have specific questions, then post applicable code and
    tell us what the problem is and if it is due to compiler error or
    runtime exception. give appropriate output.
    public class BattleSystem implements ActionListener {
        private int health;//modified
        private int enemyHealth;//modified
        public BattleSystem(){
            health = 10; //added
             enemyHealth = 5;//added
        private static void createAndShowGUI() {
            BattleSystem bs = new BattleSystem();//added
             //health = 10; deleted
             //enemyHealth = 5;deleted
            //Make sure we have nice window decorations.
            JFrame.setDefaultLookAndFeelDecorated(true);
            //Create and set up the window.
            JFrame frame = new JFrame("Battle System");
            Toolkit theKit = frame.getToolkit();
            Dimension wndSize = theKit.getScreenSize();
            frame.setBounds(wndSize.width/4, wndSize.height/4,
                                wndSize.width/4, wndSize.width/4);
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            //Buttons
            JButton attack = new JButton("Attack!");
            attack.addActionListener(bs);//modified
            //Health Labels
            JLabel healthLabel = new JLabel("Health: " + bs.health);//modified
            JLabel eHealthLabel = new JLabel("Enemy Health: " + bs.enemyHealth);//modified
            //Set up the content pane.
            Container contentPane = frame.getContentPane();
            SpringLayout layout = new SpringLayout();
            contentPane.setLayout(layout);
            //Add the labels to the frame
            contentPane.add(healthLabel);
            contentPane.add(eHealthLabel);
            contentPane.add(attack);
            //Adjust constraints for the eHealthLabel so its pos is 145,0
              layout.putConstraint(SpringLayout.WEST, eHealthLabel,
                         145,
                         SpringLayout.WEST, contentPane);
              layout.putConstraint(SpringLayout.NORTH, eHealthLabel,
                         0,
                         SpringLayout.NORTH, contentPane);
              //Adjust constraints for the Attack so its pos is 145,0
              layout.putConstraint(SpringLayout.WEST, attack,
                         0,
                         SpringLayout.WEST, contentPane);
              layout.putConstraint(SpringLayout.NORTH, attack,
                         25,
                         SpringLayout.NORTH, contentPane);
            //Display the window.
            frame.setVisible(true);
            //Handle Button Events
            public void actionPerformed(ActionEvent e) {
                 health--;
                 enemyHealth--;
        public static void main(String[] args) {
            //Runs the program securely and shows GUI
            javax.swing.SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    createAndShowGUI();
    }

  • Airport Express problems with Vista

    I have read on here that people are running the express with Vista an I am not sure how? I loaded the disk and everything come up but the Airport setup assistant. When I open the Airport asmin utility it is blank. I am not sure how to get this up and running any help is appriciated.

    I have the exact same problem trying to connect my Airport Express to my Vista laptop. I managed to get around it by using the Admin Utility, choosing "Other..." and then entering the router IP (for me 10.0.1.1) and password "public".
    However after I have enabled WPA2 Security the connection does not work that good. After a short while throughput is degraded and then it drops the connection completely.
    Is Airport Express supposed to work with Vista or what am I doing wrong?
    HP Pavillion Vista   Other OS  

Maybe you are looking for

  • How to Use Function_Loader_Inlay in SCM APO Version 4?

    Hi , I was going through the SE38 - Program - Function_Loader_Inlay , to check the possibilities of upload and download product/location combinations in SCM APO version of 4.0. But I am not able to use it as per the selection screen given. Please let

  • Ibook and tiger

    I have an ibook g3 with 640 memory and 30g hd. I think it has a dvd player as I can watch movies on it. I also have an imac intel and the discs for Tiger for the itel mac. does anyone know if Apple will send me the discs for the ibook since I already

  • Text-Variables for 12 selection based on 1 Date Variable

    Hello. I have a report where the user is being prompt to enter a start date (YYYYMM) in a variable.  Based on that, my report have 12 selection using the variable + offset(1), + offset(2) .... + offset(11). For the label of my columns, I'd like to di

  • Lightroom 3.3 importing images not requested?

    It seems the new update pulls in images from other Creative Suite folders we have. How do you shut this off?

  • SSIS Package, Use Datepicker control in VB script task

    Dim dateTimePicker1 As New DateTimePicker() Controls.AddRange(New Control() {dateTimePicker1}) MessageBox.Show(dateTimePicker1.Value.ToString()) dateTimePicker1.Value = DateTime.Now.AddDays(1) MessageBox.Show(dateTimePicker1.Value.ToString()) In an S