Solved

HTTP POST to SQL

Posted on 2014-09-22
7
174 Views
Last Modified: 2014-09-24
Hi, a company wants to send us some data and the only way they can do it is VIA HTTP POST.

What is the easiest way to get this data in to our SQL server, is it also possible to do this with SQL express?
0
Comment
Question by:CaptainGiblets
  • 4
  • 3
7 Comments
 
LVL 11

Accepted Solution

by:
Dany Balian earned 500 total points
ID: 40336834
1. to send this via http post, means you have to have a web server.
2. web servers could be mainly either windows (asp or asp.net depends on the host), or linux (php or any other server side scripting language). Viewing that you want to do this using sql express, means the webserver should be microsoft.
3. here's a short tutorial on how to handle post requests in asp. ASP Forms
4. finally when you receive the data via request.form("fielddatayouwanttoreceive"), you can connect to any database you like (sql express in your case), and store that data.

hope this helps,

regards,

dany
0
 
LVL 6

Author Comment

by:CaptainGiblets
ID: 40336887
So I am going to have to do at least a little bit of coding in ASP?
0
 
LVL 11

Expert Comment

by:Dany Balian
ID: 40336904
yes definitely! there's no way to do http post except on a web server.. and that involves writing the webserver (either in asp, php, or any other server scripting language).

then, the client has to access that page. so, the page has to be accessible online (if you don't have a webserver, then you have to have a fixed ip on the webserver) and you give that ip to ur client.

hope this clarifies things
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 6

Author Comment

by:CaptainGiblets
ID: 40338731
I have set up an IIS server with ASP and created a test page where I post a simple post and it displays on a webpage fine.

I am now trying to get it to drop this to a CSV however the guides I find on the internet all use code like this

<%
 dim fs,fname
 set fs=Server.CreateObject("Scripting.FileSystemObject")
 set fname=fs.CreateTextFile("c:\test.txt",true)
 fname.WriteLine("Hello World!")
 fname.Close
 set fname=nothing
 set fs=nothing
 %>

When I am trying to run these I get the error message

Compiler Error Message: BC30807: 'Let' and 'Set' assignment statements are no longer supported.
Source Error:
Line 1:  <%
Line 2:  Set fs = CreateObject("Scripting.FileSystemObject")
Line 3:  Set wfile = fs.OpenTextFile("c:\Mydir
 

Is there an easy way to do this? I'm guessing all the guides I find are older code that is no longer supported.
0
 
LVL 11

Expert Comment

by:Dany Balian
ID: 40340928
just use:
fs=CreateObject("Scripting.FileSystemObject") 

Open in new window

and
wfile = fs.OpenTextFile("c:\Mydir...

Open in new window

without the Set Keywords
0
 
LVL 6

Author Comment

by:CaptainGiblets
ID: 40341019
ARound 3 pages deep in to google i found a page that said "just remove set and let". I seem to have it working now thanks for your help.
0
 
LVL 11

Expert Comment

by:Dany Balian
ID: 40341035
Great, Glad i could help!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Having an SQL database can be a big investment for a small company. Hardware, setup and of course, the price of software all add up to a big bill that some companies may not be able to absorb.  Luckily, there is a free version SQL Express, but does …
I have a large data set and a SSIS package. How can I load this file in multi threading?
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question