Solved

HTTP POST to SQL

Posted on 2014-09-22
7
176 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Independent Software Vendors: 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!

 
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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
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 set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how the fundamental information of how to create a table.

728 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