snootalope
IS-IT--Management
I'm stumped, so i hope an expert can help me out here. I got some vb in an excel 2007 spreadsheet that accesses a mysql database just fine. I've got it to where excel can dump info to the db, but now I'm trying to pull it. So, here's what I got (besides all the connection info):
This info dumps a figure into a table in mysql. That table has it's first column set as an incrementing number. The data dumps just fine to the db in the row it's suppose to and gets a number assigned. My objective here is once the below script runs, it then has to get the number it was assigned and return it to excel and place it in a certain cell. Can anyone point me in the right direction, I'm about googled out..
--------------------------------------------
With Worksheets("sheet1")
For i = 5 To 6
If .Cells(i, 3) = "" Then Exit For
sqlstr = "INSERT INTO " & table2 & " SET " _
& field6 & " = '" & .Cells(i, 3) & "'"
conn.Execute sqlstr
Next i
End With
--------------------------------------------
This info dumps a figure into a table in mysql. That table has it's first column set as an incrementing number. The data dumps just fine to the db in the row it's suppose to and gets a number assigned. My objective here is once the below script runs, it then has to get the number it was assigned and return it to excel and place it in a certain cell. Can anyone point me in the right direction, I'm about googled out..
--------------------------------------------
With Worksheets("sheet1")
For i = 5 To 6
If .Cells(i, 3) = "" Then Exit For
sqlstr = "INSERT INTO " & table2 & " SET " _
& field6 & " = '" & .Cells(i, 3) & "'"
conn.Execute sqlstr
Next i
End With
--------------------------------------------