Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  • Users: andyc209
  • Content: Threads
  • Order by date
  1. andyc209

    OLD DB Error

    I am using 2008 R2 and trying to build an Excel file from data within SQL I am using the following code SET @SQL=N'INSERT INTO OPENROWSET(''Microsoft.ACE.OLEDB.12.0'',''Excel 8.0;HDR=YES;DATABASE='+@FILENAME+''',''Select * from [Whitelist$]'')SELECT PHRASE FROM dbo.TBL_PHRASE WHERE TID =...
  2. andyc209

    MSSQL connection Noobie

    Sorry i know this is basic but i am trying to connect to MSSQL - usually use ASP but trying PHP - and getting errors with my connection string. <?php $serverName = "IPAddress\server,port"; $connectionInfo = array( "Database"=>"dbName", "UID"=>"****", "PWD"=>"********"); $conn = sqlsrv_connect(...
  3. andyc209

    Export Data from query to Word or PDF form

    I am looking to export data from a query to existing form fields in a word or PDF document - essentially pass client name, address details to a document for them to sign. I know doing this via PDF is probably more difficult - has anyone managed this before? Any ideas that could help me tnanks
  4. andyc209

    VPN Puzzle

    We have a VPN connection between two offices using Draytek Vigor 2830n boxes. Over the last few days the connection has been really slow for users accessing shared folders/files and using remote desktop. We have checked the connections with pings etc and spoken to the line providers and...
  5. andyc209

    Variable in Openrowset

    i am trying to pass a variable into an Openrowset - i have seen its not possible this way but not sure what the solution will be. I need to do it as i have multiple files in need to pull data in from, my incorrect code is below: DECLARE @XFILENAME AS VARCHAR(50) DECLARE CUR_UPDATE SCROLL...
  6. andyc209

    split string

    i am looking to split a string into its individual words and then store these words in a table via a stored proc my table is tbl_words with a column called words if the string is 'i am stuck with sql' then i want the rows in the table to be each word in that sentence. thanks for any help
  7. andyc209

    Query getting no records

    Please bear with me as i am trying PHP for the first time i have the following code and it gives me no errors but no records - am i missing something? <?php // Connects to your Database $dsn="DBNAME"; $username="sa"; $password="xxxxxxx"; $sqlsrv_connect=odbc_connect($dsn, $username...
  8. andyc209

    xp_CMDShell

    tried creating and editing CSV files with data from SQL on another thread i have tried BCP but it has had problems so tried another method. I am copying a template CSV file, using Openrowset and then running a Batch file to remove the headers for import into another program EXEC sp_configure...
  9. andyc209

    BCP error

    trying to create a BCP that will export data from a table to a CSV file. I have the following code: DECLARE @bcpCmd VARCHAR(8000) SET @bcpCmd = 'bcp "SELECT company, address, postcode FROM tbl_ifa" queryout D:\folder\test.csv -c -t, -r -T -S SERVERNAME' EXEC master..xp_cmdshell @bcpCmd but...
  10. andyc209

    SQL generating Word Document

    I have found a lot of info on inserting data from word and inserting whole documents into sql but not the other way around. I have a template word document that is an invoice and i want SQL to be able to run a SP that will insert data into this document on an automated basis. I have seen...
  11. andyc209

    IF OR ELSE statement

    I am using the following script for a form <script type="text/javascript"> $(document).ready(function(){ $('input[type="radio"]').click(function(){ if($(this).attr("value")=="Q1YES"){ $(".box").hide(); $(".yes").show(); }...
  12. andyc209

    Access to specific tables

    I have an SQL Server on a remote server to which i log in with a specific username and password. I want to allow other users access to three tables only on one specific database for them to view and download data. How can i give them access without giving them the admin username and password...
  13. andyc209

    Truncated Data

    I am posting data from a table to excel using openrowset however i keep getting 'String or binary data would be truncated.' errors which i assume means the data i am passing is too big. My code is below: DECLARE @SQL3 as varchar(max) SET @SQL3=N'INSERT INTO...
  14. andyc209

    PHP Noobie

    after years of doing classic ASP i am giving PHP a go so bear with me. i am trying to test a simple build a table from data in my SQL database and i keep getting errors, can someone check my code <?php // connect to the database $connect = odbc_connect("ODBCNAME", "USERNAME"...
  15. andyc209

    Find Square brackets in Word

    Have been asked to create a short cut key in word so a user can tab through a document straight to where he has inserted square brackets (he uses them to identify where he needs to add text later to a template letter). I have tried to assign short cut keys etc in word but i think this has to be...
  16. andyc209

    Export to Excel target cells

    I want to export my query data to excel which is easy enough using OpenRowset, however i want to be able to target the data to specif cells eg Query returns a value of money that i want to put in cell B5 in excel - can i target this cell with the result? My code to post the results at the...
  17. andyc209

    Drop Down menu date change

    Is there a script i can use to do the following I have 4 text fields each with different dates in and a drop down select menu with numbers from 1 to 28. If the user selects 10 from the drop down (months) it automatically changes the dates in the four text fields (date1,date2 etc) to add 10...
  18. andyc209

    Stored Proc and remote file

    I have a stored procedure running on our data server that uses database mail to send out emails with attachments. The problem i have is that the file to be attached is on our webserver. if i map drives between boxes and use this new path or if i use the IP of the webserver the proc always...
  19. andyc209

    date issue

    probably really easy but its foxed me i have a date field in which a number of records have the date as DateTime and it shows todays date as 4/10/2010 00:00:00 but if i create a query with Getdate() it does not find the above records as getdate() has the time as well i assume how can i do the...
  20. andyc209

    Export SQL data to PDF

    I have a PDF document which has a few monetary values in it, i want to be able to update the document from a query in SQL and then save the updated PDF as a unique file name. I assume i will need text fields in the PDF - its just how to get the data to these fields from SQL?

Part and Inventory Search

Back
Top