Jump to content

Mike C

Members
  • Posts

    43
  • Joined

  • Last visited

Posts posted by Mike C

  1. What idea!:thumbup1:

    Unfortunately, the method works only with files that Internet Explorer is able to show independently or as a plug-in...:throwpc:

    does not work with Excel spreadsheets, which instead are downlod and opened directly with Excel ...:angry:

    Among the activeX is also available ThumbCtl ... I tried it and I saw the preview that makes the files as shown in the File Explorer ... but excel is not made the preview ... only the icon!:frusty:

    Thanks for your help ... 'm open to any suggestions!:wacko:

    Hello

    Osvaldo

    Could you convert it to a pdf before showing?

    Alternatively you can use an activex control called DSO Framer that will allow you to open an office document to display. I don't know if you can open it directly in preview mode though.

    I hope this helps

    Michael

  2. Hi All,

    I am in the process of developing a VI which would be able to send text messages to multiple mobile numbers if any error occurs in the main application.

    I tried to use Internet Connectivity toolkit's SMTP E-Mail VI, then created a filter in gmail, but still I cant get the SMS thing from LV to work.

    Is there any other way to do this?

    Thanks!

    Typically cellphone providers have email addresses associated with cellphone numbers. Maybe you can simply send an email to the phone. Here is a list of some examples I found with a quick search:

    Alltel

    [10-digit phone number]@message.alltel.com

    Example: 2125551212@message.alltel.com

    AT&T (formerly Cingular)

    [10-digit phone number]@txt.att.net

    Example: 2125551212@txt.att.net

    Boost Mobile

    [10-digit phone number]@myboostmobile.com

    Example: 2125551212@myboostmobile.com

    Nextel (now part of Sprint Nextel)

    [10-digit telephone number]@messaging.nextel.com

    Example: 7035551234@messaging.nextel.com

    Sprint PCS (now Sprint Nextel)

    [10-digit phone number]@messaging.sprintpcs.com

    Example: 2125551234@messaging.sprintpcs.com

    T-Mobile

    [10-digit phone number]@tmomail.net

    Example: 4251234567@tmomail.net

    Verizon

    [10-digit phone number]@vtext.com

    Example: 5552223333@vtext.com

    Virgin Mobile USA

    [10-digit phone number]@vmobl.com

    Example: 5551234567@vmobl.com

  3. QUOTE (alukindo @ Sep 27 2008, 07:18 PM)

    Mike:

    The SQL Server Compact Edition database requires that you reference the System.Data.SqlServerCE.dll so that it can run in-process with your executable. In this case your executable environment is LabVIEW. Once you have compiled your executable, then it will be your custom LabVIEW application run-time environment.

    I have attached a commented LabVIEW example that shows successful connection, data insert, and data read from an SQL Server CE database file. The database was created using (SQL Server Management Studio Express) SSMSE free edition downloaded from Microsoft Web Site. The database used in this example has an empty password. I tried uploading the CETest.sdf (*.sdf database) file but the upload failed. ---Rejected by the LAVA FTP server?

    Be sure to download the latest version of SQL Server CE which is 3.5 SP 1

    I hope this helps.

    Anthony L.

    Anthony,

    Thanks very much for the reply. I'll give it a try once I get a chance (unfortunately something else came up that needs my attention). This is new programming territory for me and I needed some help. Your approach makes sense and I expect it would work for me. I am surprised to see that your vi does not use any of the database vi's. Thanks again for the help.

    Michael

  4. QUOTE (rbogomir @ Sep 26 2008, 01:57 PM)

    I am also using sql server compact. I tried that connection string also and it didn't work neither. I found the strings http://www.connectionstrings.com/?carrier=sqlserver2005ce' rel='nofollow' target="_blank">here. I didn't give any password when creating the database. I got that error message few times. As a matter of fact, this is the only error message that I got - even for syntax errors in sql statements. Not very informative.

    Rbogomir,

    I can get the same error message even if I point to a non existent sdf file. This makes me think that the service is not even running. Is there anything else you needed to do? How did you solve your problem? I have a suspicion that I need to have IIS running for this to work, is IIS running on your machine?

    Thanks again for taking the time to help me out.

  5. QUOTE (rbogomir @ Sep 26 2008, 05:21 AM)

    I have tried the same thing and it did not work. I am actually using the sql server compact not mobile so the string I tried was a bit different: Provider=Microsoft.SQLSERVER.CE.OLEDB.3.5;Data Source=c:\mydb1.sdf

    On the up side I get a different error message now: Code: -2147467259, NI_Database_API.lvlib:DB Tools Open Connec (String).vi->test db.vi<ERR>Exception occured in Microsoft SQL Server Compact OLE DB Provider: in NI_Database_API.lvlib:DB Tools Open Connec (String).vi->test db.vi

    When you created the database did you give it a password? Is there anything else I should be aware of?

    QUOTE (Shaun Hayward @ Sep 26 2008, 08:09 AM)

    Jim,

    Thanks for the hint - I hadn't come across SQLite before - it looks like its doing much of the same kind of thing
    :)

    My only question is that the link you posted does not seem to have anywhere to actually download the toolkit - am I missing something?

    Shaun, I was just looking at that myself. I found the vi's here. I have not had a chance to try it but it looks interesting

    Michael

    QUOTE (jcarmody @ Sep 26 2008, 04:32 AM)

    on ni.com that I've had some success with.

    Anyway, good luck with your project. Please forgive me if I'm way off base.
    :oops:

    jm

    I writing an application that needs the database to be contained in a single file. My first choice was Access but I've recently heard of SQL Server Compact and I thought it may be a much better alternative. I have worked with SQL Server before so I figured it would be an easy transition. If I could only figure out how to connect to the database!

    I have no reason to want to use MS products. I will give SQLite a try, thanks for the suggestion.

  6. QUOTE (Yair @ Sep 25 2008, 01:04 PM)

    Yiar, thanks for the suggestions. I have been searching the web for a few days with no result. There is lots of examples on how to do it from within Visual Studio but that does not help. Creating my own udl had no result ( I get an error message:"NI_Database_API.lvlib:Conn getDataToModify.vi:1"<ERR>Object 0x000000 is not valid.) I tried a number of different combinations with the same error message. I have been using the normal SQL server for sometime now but this is very different.

    My guess is that I need to be calling some other dll before I can connect to the database file (the sql server compact database is contained in a single file) but I don't know how or which one. I was hoping someone else here may have used it and had some tips.

    Michael

    QUOTE (Shaun Hayward @ Sep 25 2008, 02:11 PM)

    I havent looked into it yet (due to time constraints) but SQL Compact Edition looks interesting.

    From what I have read so far (which isn't so much) it seems that it embeds a database within a particular applicatio. Therefore I would wonder whether you need to do some calls to its DLL / .Net trickery instead of a conventional UDL approach. The MSDN pages are suitably cryptic and basically talk you though using a Wizard in Visual Studio, which doesnt help so much.

    Shaun, thanks for the responce. That's exactly what I gathered by reading through various sites. I am afraid that you are probably correct in that I would need to make some dll calls. SQL server compact is a neat idea but it seems complicated to get working.

    Michael

  7. Well, I figured out a way to do it. I had to create a stored procedure to do the insert and include the "select scope_identity()" as part of it. The funny part to this is that if you do execute the stored procedure from a query the insert happens correctly but the scope_identity is not returned.

    What does work is a parameterized query where you can set parameters (what you need to insert) as well as read parameters (the scope_identity). It took some looking around to find out the correct syntax to do this (the examples in LabVIEW do not explain this well).

    I am listing below the stored procedure and the code. This was just a test so please excuse any cosmetic sloppiness.

    Stored Procedure:

    CREATE PROCEDURE [dbo].[uSER_INS] (@userFullNM varchar(100),@username varchar(50),@adminpass varchar(50), @roleid int, @isactive int, @userid int output)

    AS

    BEGIN

    SET @USERID = NULL

    SELECT @USERID = [uSER_ID] FROM [uSER] WHERE USER_FULL_NM = @userFullNM

    IF @USERID IS NULL

    BEGIN

    INSERT INTO [user]

    (user_full_nm, username, admin_password, user_role_id, is_active, create_dtm, last_update_dtm)

    VALUES(@userFullNM, @username, @adminpass, @roleid, @isactive, GetDate(),GetDate())

    SELECT @userid=SCOPE_IDENTITY()

    END

    ELSE

    BEGIN

    UPDATE [uSER]

    SET username = @username,

    admin_password = @adminpass,

    user_role_id=@roleid,

    is_active=@isactive,

    last_update_dtm = GetDate()

    WHERE [uSER_ID] = @USERID

    END

    END

  8. I have tried using a semicolon to indicate where each query ends but it did not work. I suppose the LabVIEW toolkit cannot execute more than one query per SQL statement. I did take a quick look at the blog and it seems that there is still a more than one query per SQL statement so it will probably not work. I'll give it a try though.

    QUOTE (orko @ Apr 25 2008, 04:06 PM)

    Not true. They are actually two seperate queries that are run one right after the other. The SQL 2005 management studio is smarter than the LabVIEW DBC Toolkit, in that it knows every command that the SQL server is capable of processing, and what syntax they require. So it doesn't care if you put a semicolon at the end of the statement or not.

    The LabVIEW DBC Toolkit however would probably need to know where each query ends. I would suggest placing a semicolon in between the two queries and trying it out. It still may not work, I'm not sure if the DBCT is capable of executing multiple queries from the same SQL statement. But I gaurantee you that if your application sends the INSERT and SELECT statements as two different queries that it should work.

    There are actually alternative ways of getting a "last ID used" return with one INSERT/UPDATE/DELETE query using an OUTPUT syntax that you would use if you were worried about other processes inserting in-between your last insert and your scope_identity() query...I just can't seem to find a link to give you for that...

    oh wait, here's a http://weblogs.asp.net/esanchez/archive/2006/04/24/443757.aspx' rel='nofollow' target="_blank">Blog article that describes it.

  9. Thanks for the quick responses. I'll try and provide some answers to your questions:

    1. There are no error messages

    2. Using a termination character has no effect

    3. The insert and select scope_identity() need to be in the same command. The scope_identity() is supposed to return the table primary key ID the insert had

    4. Database: SQL Server 2005, ODBC connection

  10. Hello everyone. I am using the following SQL query to get the primary key ID following a record insert but nothing is returned:

    Insert into tblname (field_1, filed_2) Values ('value1', 'value2')

    select scope_identity()

    This query works as expected in the SQl server Management studio but not in LabVIEW.

    I am using the LabVIEW database connectivity kit with LabVIEW 8.5.

    Does anyone have a solution to this problem?

    Thanks,

    Michael

  11. QUOTE(rolfk @ Nov 27 2007, 04:41 PM)

    If you want to use the internet toolkit you certainly can go into the VI library and modify it in such a way to provide somehow some information in a global variable about the current size. The internet toolkit FTP VIs if you dig into them, does basically read multiple blocks inside a loop writing them to the desired file, until all data has been retrieved or the connection is aborted.

    There is no current progress information because the high level VI to download a file is written in such a way to only return on a finished download or on error. So there would be never a meaningful progress return value from that VI itself. The information you want to know is deeper inside that VI hierarchy and you will have to modify those VIs somewhat to give you that information in a meaningful way.

    Rolf Kalbermatter

    After Aristos' comment I started looking into the low level vis and found that there is a single vi (tcp read) in a loop that reads a specific amount of data (4kb by default) every iteration until the entire file is downloaded. I guess I need to do some rearraging in order to get the info I want.

    Thanks for all the help everyone.

    Mike C

  12. Thanks for the suggestion everyone.

    I am planning on using the Labview internet toolkit VIs for this project but was unable to find any output indicating how much data was received at any point in time. Justin's suggestion of polling the file size of the downloded file might work but I agree that it's not very elegant.

    How do other programs (FTP clients, browsers, download utilities, etc) know how much data was received?

    MikeC

  13. hello Mike C,

    Thank you for the explanation. Then it is possible send sms indirectly with Labview, through one

    SMS gateway.

    thank you, Mike C

    Eerc, I am not sure how one would use an SMS gateway to sent an sms to a cell phone. From what I have seen you would need to subscribe to some kind of service that allows you to do that.

    In searching for an answer to your question (I've been wondering myself how to do this), I have found that you may be able to send an sms to a phone by simply sending an email to the phone. In my case my mobile provider (US Cellular) allows an email to be sent to a phone. I can send an email to 'myphonenumber@email.uscc.net' and it will show up as a text message on my phone. Other providers may allow this or provide it as a service (maybe for free).

    Check with your mobile provider if you can do this.

    I hope this helps

    Michael

  14. And possible to send sms with labview?

    Thank

    Hugo Fernandes

    Hugo, I was looking to do the same thing some time ago but I had to postpone that project. I did find some information on the NI Knowledge base that may give you some direction:

    "Problem:

    Can LabVIEW send a text message to my mobile phone email address?

    Solution:

    LabVIEW can indirectly send text messages to a cellular phone with the SMTP E-Mail VI

  15. Hello everybody. I have an interesting problem. The company I work for requires that all programs released have a version number associated with them that can be read by the GetFileVersionInfo function. None of my LabView programs return a version number, they actually return 0.0.0.0. Is there a way to provide version information that will eventually be stored in the final executable?

    Thanks

    java script:emoticon(':headbang:')

    smilie

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.