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 Andrzejek 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: *

  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

    so would i need front end code like ASP etc to do this
  4. 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
  5. 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...
  6. andyc209

    Variable in Openrowset

    excellent thankyou so much - seems to be fine :)
  7. andyc209

    Variable in Openrowset

    i have seen this done but cannot see how to fit it into my code - most of the exapmles i have found on google are delete etc rather than the insert into i have
  8. 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...
  9. 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
  10. andyc209

    Query getting no records

    I have found the following code online which i can get an error from <?php //connect to a DSN "myDSN" $conn = odbc_connect('PPORTAL','PHP','PHP1'); if ($conn) echo "odbc connected"; else echo "odbc not connected"; ?> It comes back withh the ODBC not connected line but if i test the...
  11. andyc209

    Query getting no records

    They query works fine in SQL - brings back records.
  12. 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...
  13. 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...
  14. andyc209

    BCP error

    thanks for the help tried this - i changed to : DECLARE @bcpCmd VARCHAR(8000) SET @bcpCmd = 'bcp "SELECT company, address, postcode FROM mytestdatabase.dbo.tbl_ifa" queryout D:\folder\test.csv -c -t, -r -T -S SERVERNAME' EXEC master..xp_cmdshell @bcpCmd...
  15. 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...
  16. 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...
  17. andyc209

    IF OR ELSE statement

    cheers jpadie - works great -so grateful for the help. so i understand the script is saying if i tick more than 0 'YES' boxes show the Yes div but if the No's equal the total number of radio/2 then show the No - sound about right?
  18. andyc209

    IF OR ELSE statement

    thanks for the response but it did not seem to work i have created a basic page with a sample form on - the full code is can be seen 'view source' Link
  19. 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(); }...
  20. 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...

Part and Inventory Search

Back
Top