Help with excel, DSN name

Hello!
I have been searching this forum+google to fin how to acces an excel file.
In some of the examples it says:
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
c = DriverManager.getConnection("jdbc:odbc:Thename","",""); // TheName is the DSN name
and I wonder what is "DSN name" how do I create that?
Thanks in advance...
/D_S

Hello
I have managed to create a DSN using controlpanel->Administration tools
I have added a "System-DSN" named "Mymembers" which is going to work with my *.xls file "c:/mymembers/mymembers.xls"
I get an error that says (my traslation)
"Cant find the object 'mymembers'. Controll that the object exists and that the right searchpath are given"
My syntax looks like:
try
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
c = DriverManager.getConnection("jdbc:odbc:Mymembers","",""); // Mymembers is the DSN name
stmnt = c.createStatement();
ResultSet rs = stmnt.executeQuery("select * from mymembers"); // mymembers is my sheet in mymembers.xls
while(rs.next())
System.out.println(rs.getString(1)+" "+rs.getString(2));
}catch(Exception e)
System.out.println(""+e.toString());
finally
try
stmnt.close();
c.close();
catch( Exception e )
System.err.println( e );
------------------------------------------------------------------------------------------------------------------

Similar Messages

  • Help with add file name problem with Photoshop CS4

    Frustrating problem: Help with add file name problem with Photoshop CS4. What happens is this. When I am in PS CS4 or CS3 and run the following script it runs fine. When I am in Bridge and go to tools/photoshop/batch and run the same script it runs until it wants interaction with preference.rulerunits. How do I get it to quit doing this so I can run in batch mode? Any help is appreciated. HLower
    Script follows:
    // this script is another variation of the script addTimeStamp.js that is installed with PS7
    //Check if a document is open
    if ( documents.length > 0 )
    var originalRulerUnits = preferences.rulerUnits;
    preferences.rulerUnits = Units.INCHES;
    try
    var docRef = activeDocument;
    // Create a text layer at the front
    var myLayerRef = docRef.artLayers.add();
    myLayerRef.kind = LayerKind.TEXT;
    myLayerRef.name = "Filename";
    var myTextRef = myLayerRef.textItem;
    //Set your parameters below this line
    //If you wish to show the file extension, change the n to y in the line below, if not use n.
    var ShowExtension = "n";
    // Insert any text to appear before the filename, such as your name and copyright info between the quotes.
    //If you do not want extra text, delete between the quotes (but leave the quotes in).
    var TextBefore = "Lower© ";
    // Insert any text to appear after the filename between the quotes.
    //If you do not want extra text, delete between the quotes (but leave the quotes in).
    var TextAfter = " ";
    // Set font size in Points
    myTextRef.size = 10;
    //Set font - use GetFontName.jsx to get exact name
    myTextRef.font = "Arial";
    //Set text colour in RGB values
    var newColor = new SolidColor();
    newColor.rgb.red = 0;
    newColor.rgb.green = 0;
    newColor.rgb.blue = 0;
    myTextRef.color = newColor;
    // Set the position of the text - percentages from left first, then from top.
    myTextRef.position = new Array( 10, 99);
    // Set the Blend Mode of the Text Layer. The name must be in CAPITALS - ie change NORMAL to DIFFERENCE.
    myLayerRef.blendMode = BlendMode.NORMAL;
    // select opacity in percentage
    myLayerRef.opacity = 100;
    // The following code strips the extension and writes tha text layer. fname = file name only
    di=(docRef.name).indexOf(".");
    fname = (docRef.name).substr(0, di);
    //use extension if set
    if ( ShowExtension == "y" )
    fname = docRef.name
    myTextRef.contents = TextBefore + " " + fname + " " + TextAfter;
    catch( e )
    // An error occurred. Restore ruler units, then propagate the error back
    // to the user
    preferences.rulerUnits = originalRulerUnits;
    throw e;
    // Everything went Ok. Restore ruler units
    preferences.rulerUnits = originalRulerUnits;
    else
    alert( "You must have a document open to add the filename!" );

    you might want to try the scripting forum howard:
    http://www.adobeforums.com/webx?13@@.ef7f2cb

  • Help with excel output.

    How can I get the out with Excel format.  Here is the steps and output desire.
    The trick is I want the excel out put with specific format date, I have tried using SSIS 2012 for several days and it did not work.  The file must be in this format.  I google and try several examples but it failed.  Here is my codes below. 
    Any help is greatly appreciate.
    I have to schedule the job to run each night and output Excel file with date format below.
    date format: DDMMYY append to the file.
    Daily_Report_280115.csv or Daily_Report_280115.xlsx
    IF OBJECT_ID('dbo.usp_RptGetUserLogin', 'p') IS NOT NULL
      DROP PROCedure dbo.usp_RptGetUserLogin
    GO
    CREATE PROCedure dbo.usp_RptGetUserLogin
    @DBName     VARCHAR(40)
    AS
    **      Description: 
    **       Written by:
    **     Written date:  01/23/2015
    **    Modifications:
    **    ------------+---------------+-------------------------------------------
    **    Date:       |  Author:      |   Reasons:
    SET NOCOUNT ON;
    SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
    DECLARE @SQLStr  VARCHAR(8000)
           ,@crlf        CHAR(1) = CHAR(13) + CHAR(10) -- carriage return, new line.
         --INSERT dbo.#AuditUserLogin (LoginId, DBName, UserName, UserOrAlias)
            --PRINT '-- go 2.'
            SET @SQLStr = 'USE ' + @DBName + ';' + @crlf + 'SELECT CAST(p1.name  AS VARCHAR(40)) AS [LoginName],
                CAST(db_name() AS VARCHAR(40)) AS [DBName],
                CAST(p.name AS VARCHAR(40)) AS [UserName],
                CAST(CASE
                  WHEN (p.is_fixed_role = 1) THEN ''MemberOf''  -- 1 = in one of the DB role.
                  ELSE ''User''
                END AS VARCHAR(20) ) AS [UserOrAlias]
           FROM sys.database_role_members AS r
           JOIN sys.database_principals AS p
             ON (r.role_principal_id = p.principal_id)
           JOIN sys.database_principals AS p1
             ON (r.member_principal_id = p1.principal_id)
          --WHERE (r.member_principal_id > 1) -- Exclusive dbo user.
       ORDER BY p1.name ASC, p.name ASC;'
       PRINT @SQLStr
       EXECute (@SQLStr)
    GO
    DECLARE @SQLString VARCHAR(5000)
           ,@sToday CHAR(6) =  REPLACE(CONVERT(VARCHAR(10), GETDATE(), 3), '/', '')
    SELECT @sToday
    SET @SQLString = 'OSQL /E -w2000 /d DBAMaintenance /S. ' + '/Q"EXECute dbo.usp_RptGetUserLogin @DBName = ''Dev''' + '" /o C:\ExcelOutPut\' + 'Daily_Report_' + RTRIM(@sToday) + '.csv'
    SELECT @SQLString
    --OSQL /E -w2000 /d DBAMaintenance /S. /Q"EXECute dbo.usp_RptGetUserLogin @DBName = 'Dev'" /o C:\ExcelOutPut\Daily_Report_280115.csv
    --EXECute Master..xp_cmdshell @SQLString
    -- Desired output:
    LoginName               DBName UserName       UserOrAlias
    dbo                     Dev       db_owner       MemberOf
    MyDomain\QA_ReadOnly_DB   Dev       db_datareader MemberOf
    MyDomain\Dev_ReadOnly_DB  Dev       db_datareader MemberOf
    MyDomain\languyen         Dev       db_datareader MemberOf
    MyDomain\languyen         Dev       db_datawriter MemberOf
    Lam                     Dev       db_backupoperator MemberOf
    Lam                     Dev       db_datareader MemberOf
    Lam                     Dev       db_datawriter MemberOf

    You try using BCP
    https://www.simple-talk.com/sql/database-administration/creating-csv-files-using-bcp-and-stored-procedures/
    BTW, Are you using SQL 2000?
    Also you can try with Powershell
    https://gallery.technet.microsoft.com/PowerShell-Export-SQL-Data-67bcb690
    --Prashanth

  • Help with Excel, please

    Would be very grateful for help with my Excel spreadsheet.
    My workbook contains 20 or so worksheets. I was trying to copy column totals across a particular sheet when it disappeared. After trying to find the missing sheet, called 'Jan 2011', and giving up, I decided as a last resort to re-create the worksheet. However, after inserting a new sheet and trying to re-name it 'Jan 2011', I get the error message that this sheet name already exists. Does anyone have any ideas on where it might be? Many thanks

    You need to post over on the Microsoft Office for Mac forums.  Google will help you find them.

  • Can you help with rematching file names

    After a computer crash needed to reload my library. When doing this I accidently clicked the option to add track numbers to song names.
    Later I was able to locate my iTunes XML from my old PC, however many of the songs (5000 out of 6000) no don't match because the original song name has been changed since my stupid error caused the files names to get the song number in front of them.
    Anybody have any tips for matching the filenames back up. In my original library some files had track numbers in front and some did not. How can I match them back up. I'm comfortable programming and modifying the iTunes XML but I can't figure out a good way to list out the contents of my hard drive to do the actual matching.
    Tony

    Because this forum software is so absolutely USELESS now, you don't get to see the whole of the question in this view. In the other (non-list) view it says:
    "can you help with a technical problem with the stereo imagery option ? it won't take out lead vocal in a stereo mp3"
    And the answer is that if you can't isolate the vocal in the stereo field, or it is one of these odd ones where it's used inverted polarity in different parts of the stereo signal for the same vocal, then you won't be able to. But without a sample, it's impossible to tell. If you can post a link to one, that might help. It has to be external to this site though - Adobe in their infinite wisdom don't allow the posting of audio files on their audio U2U forum. Helpful, that, isn't it?

  • Help with excel macros

    Good morning:
    I need help with a macro that let me solve the following situation:
    1. I have an excel file with the following format:
    Book
    Chapter
    Verse
    60
    5
    7
    43
    14
    1
    50
    4
    6
    50
    4
    7
    51
    3
    15
    23
    26
    3
    2. First I want to convert the file to this format:
    60.5.7
    43.14.1
    50.4.6
    50.4.7
    51.3.15
    23.26.3
    3. And finally to export them to a file called Bookmarks.xls with the format:
    bgroup
    verses
    Default
    60.5.7, 43.14.1, 50.4.6, 50.4.7, 51.3.15, 23.26.3
    I have some 40 files that need to be converted. All have the same format but the number of rows varies. By the way I am using Excel 10.
    Your help with this matter will be greatly appreciated.

    Perhaps you can use this as starting point:
    Sub Transform()
    Dim wshS As Worksheet
    Dim wbkT As Workbook
    Dim wshT As Worksheet
    Dim r As Long
    Dim m As Long
    Application.ScreenUpdating = False
    Set wshS = ActiveSheet
    m = wshS.Range("A" & wshS.Rows.Count).End(xlUp).Row
    Set wbkT = Workbooks.Add(xlWBATWorksheet)
    Set wshT = wbkT.Worksheets(1)
    wshT.Range("A1") = "bgroup"
    wshT.Range("B1") = "verses"
    wshT.Range("A2") = "Default"
    For r = 2 To m
    wshT.Cells(2, r) = wshS.Cells(r, 1) & "." & wshS.Cells(r, 2) & _
    "." & wshS.Cells(r, 3)
    Next r
    Application.Dialogs(xlDialogSaveAs).Show
    Application.ScreenUpdating = True
    End Sub
    Regards, Hans Vogelaar (http://www.eileenslounge.com)

  • Help with excel formula

    hi,
    I need help with some excel fomulas,  I have a source file which 2 cells will continually change, I want to link this source file to an inventory file and update the information on seperate lines when the information is changed without changing the
    destination information
    is it possible or do I have to create seperate source file

    Hi,
    According to your description, my understanding is that you have 2 files (A source file and an inventory file) and link the source file to inventory file. You want to retain the data in the inventory file when the source file continually change.
    If it is, there is no formula will retain the linked data after the data source changed.
    We may try the workarounds:
    1. Use import data from source file to the inventory file.
    2. Create seperate source file
    If I misunderstand, please let me know and share us more information about your demand.
    Regards,
    George Zhao
    TechNet Community Support

  • Sun would like your help with the "System Name Already In Use"  error

    A couple of users have reported getting an erroneous "System Name Already in Use" error when re-registering a system after a fresh Solaris re-install. We'd like your help in tracking down this problem.
    The scenario is this:
    * Install Solaris 10 and register with updatemanager,
    * Wipe out the installation and re-install Solaris.
    * re-register with updatemanager.
    The system erroneously reports that the system name is already in use. It is supposed to detect a duplicate registration of the same system.
    We have not been able to reproduce this error in our lab.
    If this has happened to you, would you let us know at [email protected]?
    Here are the things that we would like to ask of you:
    * If you run "updatemanager -debug" if will create a log file /tmp/basicreg<timestamp>.log.
    * Details on the exact hardware you have (make/model/configuration).
    * Details on the steps you took to get to the bad state. REALLY detailed!
    Thanks!
    Based on what we know now, we believe you can work around the issue by either:
    * Changing the host name and re-registering.
    * Creating a different user account and registering the host to that account.
    Some previously-posted workarounds are known NOT to work:
    * Wait 24 hours and try again.
    * Do some "ccr" incantations and try again.

    Hi,
    Can you drop me an email as i am a sun employee and i will be able to check if the swup frontline team have received any support cases on this issue and then we can work with you directly to resolve the issue.
    Scott Wallace

  • Help with excel document

    hello all,
    I have an excel base `database`on which I have been working on for about 10 years. It basically has all my music data from all this time, i.e. it is very important for me.
    I keep a copy on my Palm TX in case I need to make notes on the go, and I syncronize with the dataviz documents to go application.
    Today during sync, the process unexpectedly stopped, and now I cant seem to open the file. I double click, excel starts, but no open.
    Anyone might have any idea what caused this? If anyone can help I am willing to send the file for revision-correction.
    thanks all

    By the way, when I move the file to a PC and try to open it, I get the following message
    éxcel caused an error in MS097.dll. Excel will close
    Help!
    J

  • Need help with Excel and ActiveX

    I am new with working with ActiveX, so I need some help regarding writing to a spreadsheet. Here is what I need to do:
    1.The user weighs a product on a scale.
    2.The user presses the weight button control in labview to retrieve the weight via serial port.
    3.The value gets written into a spreadsheet, starting at D2.
    4. User weighs the same product after use to get a new weight.
    5. labview goes through the same process, but this time it gets written to E2.
    6. Differential is calculated (still debating on having the user do this in Excel instead of Labview, since they have to set up a spreadsheet outside of labview for other info not related
    to weight).
    7. User close labview when finished.
    The serial comm and all is fine, but the problem I am having is trying to get a specific cell value written in D2 and then getting another value to be written in E2. For example, initial weight would be D2 and post weight would be E2, and then differential would be F2. For the next product, it would be D3, E3, F3, and so on. What would be the best way to implement this? It looked as if ActiveX would be the only real way to tell Excel where to put the data, but there is still alot I have to learn in where to find and use the proper nodes to complete the process.
    Thanks,
    Jody M.
    The Procter and Gamble Co.
    Certified Labview Developer
    Currently using LV2012.

    Hi z2830than,
    see the attached example. It make following things: open Excel, create new Workbook, ..., write Data to D2, save Workbook and close Excel.
    Hope it helps.
    Mike
    Attachments:
    Excel_open_write_close_Example_LV71.llb ‏234 KB

  • Need help with changing the name.

    I got my palm pre from an uncle who lives in the states. The problem is I can't call tech support to ask them because I live in belize. The proble I have with my pre is that I have added my email account to the phone, but when I send an email, they receive it in my uncles name, my name is lanny and they receive an email form cesar, I think you can see where the problem lies. Is there anyway I can change it to my name? Please help!
    Post relates to: Pre p100eww (Sprint)

    Hello and thank you for using the Palm Help Forums!
    I would create a new Palm Profile. To do this you will need to go to the Device Info app, Reset Options, then select Full Erase. All pictures, videos, and anything else stored in the USB side of the device will be erased. I recommend that if you want to keep any of that to connect your device to a computer then click and drag everything you want to keep off of the device and onto your computer.
    After you perform the Full Erase the device is going to reboot. It is going to come up with a screen to sign in to a Palm Profile or Create a New Palm Profile. NOTE*** You will need a data connection to do this. Select Create a New Palm Profile and fill in the blanks. Once you are back into the device you can set up your email accounts again and it should display the name you created the Palm Profile with.
    I hope this helps,
    -Pat

  • Help with event.target.name

    I am very green with actionscript and coding in general so please forgive me if I am asking something that sounds super simple.
    Is it possible to take "event.target.name" value which in my case would be something like "SW5005_mc" and change that value.
    I use that value right now to tell another clip to gotoAndStop(event.target.name); which I have frames labeled the same as the event.target.name.
    I would like to take the value of event.target.name for instance "SW5005_mc" and remove the "_mc" and put a dash in between the "SW" and the "5005"
    to get "SW-5005" which then I would pass into a text field.
    I really don't know where to begin or if this is possible.
    Thanks for any help or suggestions,
    Chris

    yes you can do it with String manipulation, check out the various String Class methods, some examples here:
    http://www.wuup.co.uk/as3-basics-string-manipulation-in-actionscript-3/
    http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/String.html

  • Help with Excel IF AND (OR) formula

    I am trying to get some productivity numbers from a spreadsheet. I have 5 columns of data that are being looked at (Break, Kickout, Live-chat, Lunch, Restroom). I know what the threshold should be for each group. I can do it manually and I get the exact number I am looking for. The problem is getting Excel to see things my way. Here is an example of 100% productivity:(these are in seconds)1800 Break | 0 Kickout | 600 Live-Chat | 1800 Lunch | 300 Restroom1800+0+600+1800+300=4500So, for my basic formula it is easy -- 4500/(K2+M2+N2+P2+U2)That gives me a nice number to see how productive an agent was with their time.The problem I am running into is when someone does not work a full shift. If they come in for 3 hours of overtime, they will generally get a 15 minute break (900 seconds), and no lunch. So, instead of 4500 seconds allowed, it...
    This topic first appeared in the Spiceworks Community

    I am trying to get some productivity numbers from a spreadsheet. I have 5 columns of data that are being looked at (Break, Kickout, Live-chat, Lunch, Restroom). I know what the threshold should be for each group. I can do it manually and I get the exact number I am looking for. The problem is getting Excel to see things my way. Here is an example of 100% productivity:(these are in seconds)1800 Break | 0 Kickout | 600 Live-Chat | 1800 Lunch | 300 Restroom1800+0+600+1800+300=4500So, for my basic formula it is easy -- 4500/(K2+M2+N2+P2+U2)That gives me a nice number to see how productive an agent was with their time.The problem I am running into is when someone does not work a full shift. If they come in for 3 hours of overtime, they will generally get a 15 minute break (900 seconds), and no lunch. So, instead of 4500 seconds allowed, it...
    This topic first appeared in the Spiceworks Community

  • Help with excel

    Hi all ,
    i'm new to odbc .
    after 5 hours which i've tried to figure out how to do this , i'm turning to you experts.
    i got required from my manger project to make an option to an "end user" to use the option only thru the exce; , and not thru the odbc.
    the mission
    i got a text file which contain a complex query :
    select a,b,c,d
    from (
    select
    e,f,d,f
    from t)
    group by ....
    the goal is to take this file and to reload it into the excel.then make a pivot table.
    and then i guess to use the odbc ,
    the finale goal is then the user is entering to the excel and can run this query.
    for start please help me how to load this file into excel ,
    thanks in advance
    naama

    Well, the main problem is that what you're describing is connecting and running a query, which you need ODBC (or some other connectivity to the database) to do. Without that,the best you can do is run the query once, save the results into Excel, and let other people reopen whatever the results were back when you ran it instead of getting the most recent version.
    You can run your query in Excel by hitting Data (assuming you have 2007 or 2010), From Other Sources, ODBC. Connect to the database, and copy your query into the SQ window. Excel will go off and run it.

  • Help with Excel, ODBC and SQL

    I have an excel doc like this:
    A B C D E
    1 q w e r t
    2 t e s t
    3 s u p e r
    4
    5
    I have made the connection but I have problems with printing out the values. Could anybody give me a hint or 2
    Fore example how do I print out D3???? Or row 2???
    BR Soren

    you should check this article out :
    http://www.javaworld.com/javaworld/javaqa/2001-06/04-qa-0629-excel.html

Maybe you are looking for

  • MS Outlook People page will not load in Firefox. It loads in other browsers.

    I use Outlook and when I use it in Firefox version 21.0 the People page will not open. When I use Outlook in another browser the people page opens without any issues. In firefox it just clocks and clocks an then since there is a problem and stops. I

  • Why is the Watch ESPN app not working?

    All I get is that it is unavailable

  • Excise value condition type jm01

    Hi, for basic excise condition type JM01 which is maintain 14% excise rate in J1ID IN FTXP base is 100 but it is calculating 202 % where to check it

  • Error while executing RSA3

    Hi, While executing (RSA3) the data source 0CFM_DELTA_POSITIONS,I'm getting the following error:- "DeltaInfoSource 0CFM_DELTA_POSITIONS is not uniquely assigned to one position InfoSource" Please advise. Thanks & Regards Ramesh Nair

  • When trying to import a cd into iTunes

    When I import a CD into iTunes, after a few songs, the download freezes and my computer no longer recognises my drive d. The D drive (DVD/CD rom) seems to have disappeared. Since the computer does not know that I have a D drive, the DVD/CD rom will n