Solved

HTTP POST to SQL

Posted on 2014-09-22
7
167 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 6

Author Comment

by:CaptainGiblets
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Great, Glad i could help!
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Performance is the key factor for any successful data integration project, knowing the type of transformation that you’re using is the first step on optimizing the SSIS flow performance, by utilizing the correct transformation or the design alternat…
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.

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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now