Reply
ASP Error 0185
Old 08-09-2004, 07:35 AM ASP Error 0185
Junior Talker

Posts: 2
Hi,

I am trying to insert data into mysql with asp. But i get an error code 0185-Missing default property. I know the asp is connecting to mysql database because if i ask an query to obtain a result, i get some result.

I think my question is what property do i need to set up to allow me to insert data to an mysql table.

I am using mysql-4.0 and myodbc-3.5.

I tried looking the problem up on the internet but i did not find any approriate solutions for it.

Any advice will be helpful. Thanks in advance

Code:
Dim objConn, strSQL

Set objConn = Server.CreateObject("ADODB.Connection")
objConn.Open "dsn=mysql_dsn"

strSQL = "Some sort of insert statement"

objConn.Execute strSQL
guguBanana is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 08-31-2004, 12:10 PM Can try a couple of things...
wfpeyton's Avatar
Average Talker

Posts: 22
I am not too sure about that error code, but it could be referring to either the connection string or the insert statement. So two things come to mind:

This code is for MS SQL, but it should be the same for MySQL, or at least pretty close.

One:
Try setting up the connections something like this

sDSN = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=Drive:\Path\NameOfDatabase;" '


Set rs = Server.CreateObject("ADODB.RecordSet")
Set cnn=Server.CreateObject("ADODB.Connection")
cnn.open sDSN

Two:
Check that you have matching field-value pairs in the insert statement and that they are correct for the table column type

sSQL = "INSERT INTO TableName(Field1,Field2) VALUES ('"&Var1&"','String')"
cnn.Execute(sSQL)

HTH

Bill
__________________
W F Peyton
Web Site Analytics for Serious e-Commerce Sites from Web Stats Gold
www.webstatsgold.com
wfpeyton is offline
Reply With Quote
View Public Profile Visit wfpeyton's homepage!
 
Old 09-08-2004, 06:54 PM
Junior Talker

Posts: 4
Another possibility is that a field in the database is requiring a value but you are not sending one in with the SQL. In MS SQL I get a similar error if I insert into a table that I forgot to set auto increment on my primary key.

MtnMinded
MtnMinded is offline
Reply With Quote
View Public Profile
 
Old 09-08-2004, 07:51 PM
Kyrnt's Avatar
The Post-Mod Years

Posts: 2,536
Location: Western Maryland
This is an error that is commonly seen when you are trying to access an Access database via ASP that is already open in Access (heh?). Do you have the database open and are trying to test your code at the same time?
__________________
—Kyrnt
Kyrnt is offline
Reply With Quote
View Public Profile Visit Kyrnt's homepage!
 
Reply     « Reply to ASP Error 0185
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.12637 seconds with 12 queries